tags:

views:

41

answers:

3

I need two selectors:

  • one for ordinary text in a h2 element
  • and one for text within a strong tag

The first is working with:

selector: 'h2.flashHeader'

But

selector: 'h2.flashHeader strong'

doesn't work for string text.. any ideas?

Markup:

<h2 class="flashHeader">
            <umbraco:Item field="headerText" stripParagraph="true" runat="server"></umbraco:Item>
        </h2>

The Umbraco field embeds text that comes in two variants - normal and strong, like so:

<h2 class="flashHeader">
            <strong>Strong text.</strong>
some other not strong text
        </h2>
+1  A: 

If your HTML looks like this:

<h2 class="flashHeader">
  Stack <strong>Overflow</strong>
</h2>

Then your selectors should be working.

Steve
+2  A: 

$('strong') is the jQuery selector for strong / bold text.

Tatu Ulmanen
+1  A: 

Remember, 'strong' will pick up all <strong> tags, but it won't pick up text marked as bold using CSS.

Russell Giddings