0

whats the difference between class and tag?. im learning JS about DOM now

document.getElementsByClassName(name) //finds elements by tag name document.getElementsByTagName(name)

13th Oct 2018, 3:06 AM
Zulfadhli
Zulfadhli - avatar
1 Answer
+ 1
Take this HTML: <h3 class="special">This is a heading</h3> The tag name is "h3", the class name is "special". Nothing is stopping you from giving the same class to lots of different types of tags, so keep that in mind :)
13th Oct 2018, 3:29 AM
Schindlabua
Schindlabua - avatar