Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the value of inner div with class name?

The html will look like

 <div class="class1 selected">
 <div class="innerclass">value</div>
 </div>

in "class1" the class "selected" will come via some condition. So I want to get the value of "innerclass" when "class1" has class "selected". How can I get this value via jquery?

like image 732
Shafeeque S Avatar asked Nov 28 '25 15:11

Shafeeque S


1 Answers

Try this:

$('.class1.selected .innerclass').text();
like image 113
Rahul Tripathi Avatar answered Nov 30 '25 06:11

Rahul Tripathi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!