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)
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 :)