Answers for "javascript dom claas selector"

62

javascript get element by class

var elementsArray = document.getElementsByClassName("someclassname");
Posted by: Guest on June-17-2019
0

queryselector for jquery

var x = $(".yourclass")[0];
console.log('jq' + x);
var y = document.querySelector(".yourclass");
console.log('js' + y);
Posted by: Guest on April-22-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language