+ 1
What is the class attribute for?
4 ответов
+ 3
I think it offers a way to group some elements.
And then you can easily manipulate those groups using the class name by CSS and JS.
When DOM is mainly used to search elements by one of 3 different attributes:
name
id
class
Where name reference to the tag name,
id reference to identifier, (not 2 elements should have the same identifier, this allows to easily find single elements),
and class reference to a group, to easily reference to multiple, otherwise independent elements.
It should all get clear for you in CSS tutorial and JS tutorial's DOM part.
+ 2
Koder King does that link really answer the question?
0
yeah Seb TheS is right, put some effort into it Koder King , no one wants to see your shitty no effort answers. Author asks for class attribute not attributes in general.
Edit: thanks for deleting it