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
Post a Comment