javascript - Dojo.query remove class -


i want remove class use following code :

var styletoremove = query(".someclass").parent().parent().parent().parent();  styletoremove.foreach(function(node) {     domclass.remove(node, "ui-state-default"); }); 

the code works on firefox(styletoremove returns object htmldivelement) not on ie8(styletoremove returns object).

why ?

you don't need manually iterator on nodelist query returns. can require in "dojo/nodelist-dom" dependency , dojo automatically add "removeclass" method nodelist class.

require(['dojo/query', 'dojo/nodelist-dom'], function (query, nodelistdom) {     query('#x').removeclass('myclass'); }); 

i made simple jsfiddle demonstrating this.


Comments

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

java - What is the difference between String. and String.this. ? -