Is it possible to use elements without selecting them in html? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is it possible to use elements without selecting them in html?

I want to code easily

9th Jan 2019, 8:34 PM
Maxim Avanasjev
Maxim Avanasjev - avatar
1 Answer
0
no, except for selecting tags as <p> then it’s just var p = document.getElementsByTag("p"); but it’s in an array if you select by tag. so you have to do like p[0]; to acces the first paragraph
9th Jan 2019, 9:00 PM
Korijn Jagersma
Korijn Jagersma - avatar