javascript - How to select element inside button using jQuery -
javascript - How to select element inside button using jQuery -
what i'm trying is, alter i's class (which located within button
) on click
<button><i class="fa fa-square-o"></i></button>
using js code below (inside on click function):
... $(this).child("i.fa").removeclass("fa-square-o"); ...
getting child not function error
what doing wrong?
yes, there no child() method in jquery.
you may utilize find() or children() that.
$(this).children("i.fa").removeclass("fa-square-o");
javascript jquery
Comments
Post a Comment