Layer.name

JavaScript 1.2+ Nav4+ Syntax

							layer.name

Description

The name property of the Layer object refers to the NAME or ID attribute of the <layer> tag.

Example

Listing 7.339 shows how to access the layer's name.

Listing 7.339 Example of the name Property
<html>
<head>
<title> Using the name property of the Layer object</title>
</head>
<body>

<layer id="Tarzan" width=200 height=200 color= bgcolor="yellow" TOP=170
LEFT=250 VISIBILITY="show">
<center>Layer 1</center>
</layer>

<layer id="Jane" width=150 height=160 color= bgcolor="green" TOP=100
LEFT=70 VISIBILITY="show">
<center>Layer 2</center>
</layer>
							 <form name="form1"> <input type="button" value="Get Layer 1 Name" onClick='alert("The name of this layer is: " + document.layer1.name)'> ...

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.