Input Week name attribute

Definition and Usage

name Set or return the value of the name attribute of the week field.

The HTML name attribute is used to identify form data after submitting form data to the server, or to reference form data on the client using JavaScript.

注意:Only form elements with name attributes will pass their values when submitting the form.

See also:

HTML Reference Manual:HTML <input> name অতিবিক্রিয়া

Example

Example 1

Get the name of the week field:

var x = document.getElementById("myWeek").name;

Try it yourself

Example 2

Change the name of the week field:

document.getElementById("myWeek").name = "newWeekName";

Try it yourself

Syntax

Return name attribute:

weekObject.name

set name attribute:

weekObject.name = name

属性值

描述
name 规定星期字段的名称。

技术细节

返回值: 字符串值,表示星期字段的名称。

浏览器支持

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
支持 10.0 支持 支持 支持

注意: 元素在 Firefox 中不显示任何日期字段/日历。