Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3
I'm not sure what you are achieving but you can simply target a class attribute this way: document.getElementsByClassName("your_class")[0]; to target first element. (In classes there can be many elements of the same class)
29th Jan 2020, 7:58 PM
r8w9
r8w9 - avatar