javascript - Html nested element remove class -


html

<li id="tree0_2_2" data-rowkey="0_2_2">     <span>        <span></span>        <span></span>        <span class="ui-state-highlight">something</span>     </span> </li> 

jquery

var removednode = $('#tree0_2_2'); $(removednode.find(".ui-state-highlight")).removeclass('.ui-state-highlight'); 

i tried didin't worked.

how can remove class 'ui-state-higlight' ?

you missed closing quote , remove . removeclass

live demo

var removednode = $('#tree0_2_2'); removednode.find(".ui-state-highlight").removeclass('ui-state-highlight'); 

removednode jquery object , not need pass $() again. can reduce single statement.

live demo

$('#tree0_2_2 .ui-state-highlight').removeclass('ui-state-highlight'); 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

c++ - libcurl curl_easy_setopt "Unknown error" -

protocol buffers - zeromq with protobuf segmentation fault while parsing in c++ -