Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

get all classes from html file

var lst=[];
document.querySelectorAll("[class]").forEach( (e)=>{  
e.getAttribute("class").split(" ").forEach( (cls)=>{if( cls.length>0 && lst.indexOf(cls)<0) lst.push(cls);}
);
 });
console.log(lst.sort());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #classes #html #file
ADD COMMENT
Topic
Name
6+1 =