Latest web development tutorials

HTML DOM Reset name attribute

Reset Object Reference Reset objects

Definition and Usage

name property sets or returns the name attribute value of the reset button.

name attribute is used after the form is submitted to the server to transmit data or form data referenced in Javascript.

Note: After the form is submitted only name attribute of the form element will pass data values.

grammar

Setting name attribute:

resetObject.name="name"

Returns the name attribute:

resetObject.name


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute name


Examples

Examples

The following example will return the name of the reset button:

<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> This tutorial (w3big.com) </ title>
<Script>
function displayResult () {
var x = document.getElementById ( "reset1") name.;
alert (x);
}
</ Script>
</ Head>
<Body>

<Form>
Email: <input type = "text" id = "email">
<Input type = "reset" name = "reset1" id = "reset1">
</ Form>
<Button type = "button" onclick = "displayResult ()"> Displays the name of the reset button </ button>

</ Body>
</ Html>

try it"


Reset Object Reference Reset objects