What practical problem will i face if i use same #id more than one time on a page , other than validation error “ID is already defined”?

前端 未结 7 757
甜味超标
甜味超标 2021-01-13 15:09

First of all I alwyas use one #ID. just asking this question to know deep reason behind it.

Is it only a matter of W3C validation? or more than that

相关标签:
7条回答
  • 2021-01-13 16:04

    I understand why you're asking the question. Tell your students that's it's the potential problems that they will face if they use ID incorrectly. Or, other coders that want to use/alter/correct your code if you write it incorrectly.

    In other words, try not to leave slop in your wake when you build your page because it's good practice not to leave slop for other coders. And, if you come back to that page and you want to make it dynamic, you'll have slop when you're done, and you won't know why.

    0 讨论(0)
提交回复
热议问题