Latest web development tutorials

HTML DOM Submit name attribute

Submit Object Reference Submit objects

Definition and Usage

name property sets or returns the name attribute value of the submit 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:

submitObject.name="name"

Returns the name attribute:

submitObject.name


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support attribute name


Examples

Examples

The following example shows the name of the button to confirm:

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

<Form>
Email: <input type = "text" id = "email">
<Input type = "submit" name = "submit1" id = "submit1">
</ Form>
<Button type = "button" onclick = "displayResult ()"> Display name of the submit button </ button>

</ Body>
</ Html>

try it"


Submit Object Reference Submit objects