how to Change jquery to Vanilla javascript
Chittoji Murali Sree Krishna

Chittoji Murali Sree Krishna @cmuralisree

About: open source enthusiast, I like to learn and share My Knowledge around.

Location:
India
Joined:
Jan 6, 2021

how to Change jquery to Vanilla javascript

Publish Date: Mar 18 '21
7 8
$(this).parent().parent().find(".imgHide").toggleClass("imgShow"); 
Enter fullscreen mode Exit fullscreen mode

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.

Comments 8 total

Add comment