+ 1
Why there is 'id' selector?
Because, 'class' also get the job done easily and more efficiently!
6 odpowiedzi
+ 5
well Kaimi is right, ID is meant for specific selection of a single element using JavaScript (also for a label tag and I think the map tag), if you use JavaScript to select a class you would select all of the elements with that class or have to cycle through the elements to see which one is the element you want to use so as Kaimi said, they are easier to select by JavaScript
+ 1
Kaimi
Sorry, but I'm not asking for the difference between 'id' and 'class'.
0
id="abc"
#abc{
your code
}
0
id preticulller is one time used in all progrram