Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding the tag <strong> inside this div tag using jQuery

Tags:

jquery

dom

My dom looks like:

<div class="blah">
  <a href=""><img .. ></a>
  <strong>blah blah</strong>
  <a href=""><img /></a>
</div>

How can I get the value of the strong when I know the class is "blah" ?

$(".blah").find("strong") doesn't work?

like image 775
mrblah Avatar asked Nov 29 '22 12:11

mrblah


1 Answers

Try this:

$(".blah").find("strong").html();

$(".blah").find("strong") will only return the jQuery object, not it's contents.

like image 71
Pim Jager Avatar answered Dec 04 '22 11:12

Pim Jager