when we use name=“Keys” in input html tag?

放肆的年华 提交于 2019-12-20 07:18:02

问题


when we use name="Keys" in input html tag ?

i know name attribute but when we use keys ?


回答1:


The name attribute specifies a name for an input element.

The name attribute is used to identify form data after it has been submitted to the server, or to reference form data using JavaScript on the client side.

Only form elements with a name attribute will have their values passed when submitting a form. By allotting a name to an element, that name becomes a scripting variable for scripting languages such as Javascript, ASP, and PHP. The name attribute is seen most often with forms and other user-input elements.

Keys is just a name given to the element as in:

<input name="keys" ..... />

Its significance can only be identified by the script that the form will be submitted to.




回答2:


The name attribute describes which form control a piece of data (specified by the value) to the server side process to which the form is submitted.

"Keys" should be meaningful in the context of the form in which the input appears, but is meaningless taken on its own.



来源:https://stackoverflow.com/questions/4747437/when-we-use-name-keys-in-input-html-tag

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!