jquery - How to check what div span is placed in -
i trying find out div span in using jquery.
here eg.
<div id='one'></div> <div id='two'></div> <div id='three'><span id="find_me"></span></div>
thanks
use .closest()
find closest ancestor div
(.parent()
find it if div immediate parent).
$('#find_me').closest('div').attr('id')
Comments
Post a Comment