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