I have this HTML:
<div id="main"><div id="mainly">11</div><div id="mainly">22</div></div>
I want to select the div with value 11.How to do this?
I tried:
$("<div id="mainly">11</div>")
,but it didn’t work…
I don’t have only two divs with id=”mainly”.
But you should have only one div with the id “mainly” !
DOM identifiers have to be unique in order to create a “well formed” and valid markup.
So, we just assume you’are using
classesinstead ofids.