Home  >  Q&A  >  body text

input标签的 name 和 id 属性区别?

input标签的name和id属性有什么区别吗?分别起什么作用?

哈哈哈哈哈哈2859 days ago924

reply all(3)I'll reply

  • 数据分析师

    数据分析师2017-09-30 23:20:18

    What is the difference between the name and id attributes of the input tag? -PHP Chinese website Q&A-What is the difference between the name and id attributes of the input tag? -PHP Chinese website Q&A

    Please watch and learn.

    reply
    0
  • 怪我咯

    怪我咯2016-12-21 10:31:34

    给input设置id,可以通过id来给input做css样式,选择我们的DOM元素节点等等,设置name可以用于给我们的后台接收数据

    reply
    0
  • 阿神

    阿神2016-12-21 10:28:41

    id是唯一的,就像你的身份证,name就是你的名字,你可以叫小明,别人也可以叫小明,用处嘛,js操作时用来识别

    reply
    0
  • Cancelreply