HTML DOM Input Search name property
Examples
Get the name of the search field:
var x = document.getElementById ( "mySearch") name.;
x The output is: googlesearch
try it"
Definition and Usage
name attribute is used to set or return the name attribute value of the search field.
name attribute is typically used to server identifiers submitted form data, or the client as a Javascript reference identification.
Note: Only the name attribute is set, in the form submission to submit data to the server.
Browser Support
All major browsers support name attribute.
grammar
Returns the name attribute:
searchObject .name
Setting name attribute:
searchObject .name = name
Property Value
value | description |
---|---|
name | It describes the name of the search field |
technical details
return value: | String representing the name of the search fields |
---|
More examples
Examples
Modify the name of the search field:
. Document.getElementById ( "mySearch") name = "newSearchName";
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> name attribute
Input Search Object