Hi,
In http://www.w3schools.com/tags/att_standard_id.asp it is written that:
The id must be unique within the HTML document.
What if I make them equal? I often use id for numbers of objects in database, e.g. id = 5
They are in deffierntent containers, for example
<div class = "x">
<div id = "2"></div>
</div>
<div class = "y">
<div id = "2"></div>
</div>
what could be the problem of this code? Javascript should work when I want select element by id - lets say with jquery I will select this way:
$('div.x div #2')
So it will know what element I am selecting. So what possible problems are then?
Of course according to standarts I should do soemthing like this - id = "x_2" so this way I would avoid equal id's in the document. But then when I want to get number from id I have to remove "x_" part.