how to Change jquery to Vanilla javascript
Chittoji Murali Sree Krishna
Posted on March 18, 2021
$(this).parent().parent().find(".imgHide").toggleClass("imgShow");
to javaScript
for parent() we can use parentElement
for toggleClass() we can use .classList.toggle("class")
but for .find() i am not able to get any alternative in vanilla js.
💖 💪 🙅 🚩
Chittoji Murali Sree Krishna
Posted on March 18, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.