HTML 5差异输入ID和输入名称? [英] HTML 5 difference input id and input name?

查看:149
本文介绍了HTML 5差异输入ID和输入名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



所以这里是我的一小部分代码



pre> < label for =name>名称< / label>

所以我的问题实际上是:

NAME和ID之间有什么区别?目的?哪一个更重要?

解决方案

简而言之,名称是提交表单时发送给服务器的标识符。 id 是浏览器,clientside,javascript等的唯一标识符。


I'm busy with something for school in HTML 5.

So here is my bit of code

<label for="name">Name</label>
<input type="text" id="name" name="name" placeholder="your name" required><br>

So my question actually is:

What is the difference between the NAME and the ID? purpose? which one is more important?

解决方案

In short, the name is the identifier that is sent to the server when you submit the form. The id is a unique identifier for the browser, clientside, for javascript and such.

这篇关于HTML 5差异输入ID和输入名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆