HTML DOM name Property
Complete Select Object Reference
Definition and Usage
The name property sets or returns the name of a dropdown
list.
Syntax
Example
The following example alerts the name of a dropdown list:
<html>
<head>
<script type="text/javascript">
function getName()
{
alert(document.getElementById("mySelect").name)
}
</script>
</head>
<body>
<form>
<select name="mySelect" id="mySelect">
<option>Apple</option>
<option>Pear</option>
<option>Banana</option>
<option>Orange</option>
</select>
<input type="button" onclick="getName()"
value="Alert name">
</form>
</body>
</html>
|
Try-It-Yourself Demos
Get the
name of a dropdown list
Complete Select Object Reference
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|