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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -