user3061155
user3061155

Reputation: 41

same ID for two different html element

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

Answers (1)

Random Dev
Random Dev

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

Related Questions