javascript - HTML Classes WITH IDs -
I'm a bit confused about HTML classes and IDs, because I want to describe an HTML element of both of them Want to use Is this supported and supported by most browsers?
The inspiration to use both of me is:
- I have a CSS style that I would like to apply to many elements
- I have There are some AJAX and Javascript which will manipulate similar elements, so I need a method of identifying which ID is using.
- That's why I want to identify each element for an ID JS manipher and at the same time I would like to specify a class so that the same style applies to the same CSS.
An ID will be unique to only one item, where one class has multiple items Can be used for group together.
Search for finding many articles about this topic. Example:
For example: You can use JavaScript as a class to markup with a unique identifier and CSS for JavaScript. Example:
& lt; Ul & gt; & Lt; Li class = "weird" id = "item1" & gt; First item in the list & lt; / Li & gt; & Lt; Li class = "even" id = "item2" & gt; Second item in the list & lt; / Li & gt; & Lt; Li class = "weird" id = "item 3" & gt; The third item in the list & lt; / Li & gt; & Lt; / Ul & gt;
Comments
Post a Comment