How to put in a variable the child element of the selected object? tried this:

$('.q1').click(function(){ var $b=$(this); var $c=('$b span'); }); 
 <div class="q1"> <span>123</span> </div> 

...does not exceed.

  • one
    var $c = $b.find("span"); - Igor
  • add to your html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> - Igor
  • @Igor Already everything you need is connected. Thank. - PeGaS

0