dom - JavaScript get elements by class name and tag name -


i wanted list of dom elements class name , tag name in javascript, not using jquery.

for example need <ul> elements class .active

var elements = document.getelementsbytagname("ul"); var activeelements = document.getelementsbyclassname('active') 

what fastest , best way in pure javascript.

no external libraries jquery or cheerio

document.queryselectorall('ul.active') 

Comments

Popular posts from this blog

javascript - Trigger mouseenter when an animated element touches mouse -

json - Zend error Connection -

java - Using Spring @Transactional with a combination of readOnly and write, when does this entity get committed? -