Skip to content Skip to sidebar Skip to footer

Event.target.parentnode... Pointing To Different Parents In Chrome And Firefox?

In this project am working on I have button that has and image inside it for styling purposes... I am trying to implement the functionality such that when the button is clicked I u

Solution 1:

Why use jQuery and chain parentNode or .parent()?

.closest() will do the job for you https://api.jquery.com/closest/

post_id = $(this).closest("[data-postid]").data().postid;

Post a Comment for "Event.target.parentnode... Pointing To Different Parents In Chrome And Firefox?"