angel_dust
angel_dust

Reputation: 151

Does "id" become unique if the display property of the element with the same id is set to "none"?

Let's say you have a DIV element with id="row" in your document. And then you inserted a new DIV with the same id name and set the display property of the previous DIV to "none". Does that id of the newly created DIV become unique?

Upvotes: 0

Views: 148

Answers (2)

Mehdi Salimi
Mehdi Salimi

Reputation: 21

No..It doesn't matter if they are hidden(display :"none")or not they are still in the document. Even if they are created dynamically they shouldn't have the same ID. "it's not a valid markup"

Upvotes: 1

Soroush Bgm
Soroush Bgm

Reputation: 532

No. Display:none is just a CSS property. Which means the element doesn't render in the view. But it exists in DOM. It exists in your syntax, and JS can work with it.

Upvotes: 1

Related Questions