var items = document.getelementsbyclassname("classname");
gives me .classname
classes, how update code classes excluding .classname_exclude
?
rather using method .getelementsbyclassname()
, use method .queryselectorall()
(which accepts css3 selectors) , use :not()
pseudo class negate elements:
var items = document.queryselectorall('.classname:not(.classname_exclude)');
Comments
Post a Comment