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 -

Python ctypes access violation with const pointer arguments -