Reputation: 41
I want to develop a web application in html where I will have various designs of html templates. Now somewhere the criteria is that I will have same pages with different data. The pages between themsalves will work like tab means the pages will create once. Now because the pages will have same design means they have same ID. So using Javascript OOP framework how can I add two different html element by same id
Upvotes: 1
Views: 39
Reputation: 52290
The ID should be unique for the document (says the HTML specs) - so better don't.
Normaly you use class
attributes and semantic meaning (div/li/...) to make those kind of selections. And of course most Javascript frameworks (jQuery comes to mind) help you with the selection of those.
Upvotes: 2