`
ladymaidu
  • 浏览: 681213 次
文章分类
社区版块
存档分类
最新评论

name和id的区别?

 
阅读更多

Id should be unique. That is, an id should apply to only one element
within a page. Lots of elements can share the same "name" however.
This is why the DOM gives you "getElementById(SomeId)" to return a
single element, and "getElementsByName(SomeName)" to return a
collection of elements.

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics