Radio.name

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

							radio.name

Description

The name property of the Radio object represents the NAME attribute of the HTML <input> tag that creates the Radio button. This allows you to reference a Radio object directly by name.

Example

Listing 7.438 shows how the name of the radio button is used to access its properties.

Listing 7.438 Accessing Radio Button by Name
<html>
<head>
<title> Example of the radio name property</title>
</head>
<body>

<form name="form1">
<input type="radio" name=myButton>Box 1
<br><br>
<input type="button" value="Get Name" onClick='alert("The name of the button is: " +
document.form1.myButton.name)'>

</form>

</body>
</html>
							
							
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.