TellJohn TellJohn - 2 months ago 6x
HTML Question

parent parent children children etc

Im trying to target a div outside of my Jquery button element. The way I'm doing it right now is


There must be and easier way? The element has a class but there are more identical elements I also need to adjust individually.




Maybe use something like:

$(this).closest('.pucontent').find('input.fontSize').val(); // You'll get font size.
// or
$('input.fontSize', $(this).closest('.pucontent')).val();

Read about .closest() and .find() or better read article about traversing in jQuery