How to use same div id for multiple div [Resolved]

Posted by Thiru under ASP.NET on 9/15/2011 | Points: 10 | Views : 7640 | Status : [Member] | Replies : 3
Hi
Asp.Net is not allowing us to use same id for two or more div tags.

example:
<div id="wrap">oneoneone</div>
<div id="wrap">twotwotwo</div>
<div id="wrap">threethree</div>


Shows warning message as: Warning 53 Another object on this page already uses ID 'wrap'.

But i want to use the same id for many div tag in a page.

any solution?




Responses

Posted by: Akiii on: 9/16/2011 [Member] Bronze | Points: 50

Up
0
Down

Resolved
Hi,
In HTML, "id" is unique. You cannot use a duplicate one in a page as it will show error.
Solution to your problem is use class instead of id if you want to repeat it.

Refer to the links:-

http://www.w3schools.com/tags/att_standard_id.asp

http://www.w3schools.com/css/css_id_class.asp

Thanks and Regards
Akiii

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lokesh76 on: 9/16/2011 [Member] Starter | Points: 25

Up
0
Down
Yes you get warning but not error and its work for you. I don't know what exact you are looking for, please put more light on your problem scenario.

Thanks
Lokesh Kumar

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 9/20/2011 [Member] Bronze | Points: 25

Up
0
Down
Thank you Lokesh....

Happy coding...
Regards
Akiii

Thiru, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response