开发者

What is the jquery selector for strong/bold text?

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"&g开发者_高级运维t;
            <strong>Strong text.</strong>
some other not strong text
        </h2>


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


If your HTML looks like this:

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

Then your selectors should be working.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜