I want to perform some action on elements that are not direct child of the body. How can I check a particular element to know whether its partent is the body.
Thanks!
You can test the tag name this way :
jQuery('#urDivId').parent().is('body')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With