id和name属性有什么区别?它们似乎都与提供标识符的目的相同.
id
name
我想知道(特别是关于HTML表单)是否有必要或鼓励使用两者都是出于任何原因.
html attributes
使用<div id="here" ...而不是使用是否有任何优势<div name="here" ...
<div id="here" ...
<div name="here" ...
它们都被称为#here?
html
一个简单的问题:id如果没有它们也能正常工作,为什么我们应该将它们添加到 HTML 标签中?我知道它们的用途之一是能够通过主题标签 ( #) 浏览页面,但是它们还有其他用途吗?
#
html ×3
attributes ×1