Input Range nameProperty

Input Range 对象参考手册Input Range Object

Examples

Get the field name of the slider control:

var x = document.getElementById("myRange").name;
xThe output result is:
points

Try it Yourself »

Definition and Usage

The name property is used to set or return the value of the name attribute of the slider control.

The name attribute is usually used as an identifier for submitting form data to the server, or as a reference identifier for JavaScript on the client side.

Note:Only when the name attribute is set can data be submitted to the server after form submission.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name attribute

Note:Internet Explorer 9 and earlier IE versions do not support HTML <input> elements with the type="range" attribute.


Syntax

Return the name attribute:

rangeObject.name

Set the name attribute:

rangeObject.name=name

Property Values

Value Description
name Describes the name of the slider control

Technical Details

Return Value: A string representing the name of the slider control


More Examples

Example

Modify the name of the slider control:

document.getElementById("myRange").name = "newRangeName";

Try it Yourself »


Related Pages

HTML Reference Manual:HTML <input> name Attribute


Input Range 对象参考手册Input Range Object Other Extensions