Sunday, 29 September 2013

Two elements with the same id, want to select one contained in a specific div

Two elements with the same id, want to select one contained in a specific div

I have something like this
<div id='container0'>
<input id='item0'>
</div>
<div id='container1'>
<input id='item0'>
</div>
I want to select the second item0 (the one in div container1) and change
it's id to item1. Best way to do this? Is there a way I can select all
item0's on a page and then check their container div and make sure it
matches to 'container1'?
Thank you for your time.

No comments:

Post a Comment