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

c - Compilation of a code: unkown type name string -

ubuntu - Bash Script to Check That Files Are Being Created -

Php operator `break` doesn't stop while -