HTML DOM Map name Property
-- Learning is not just about technology, but also about dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
JavaScript Reference
JavaScript Objects
- JavaScript Array Object
- JavaScript Boolean Object
- JavaScript Date Object
- JavaScript Math Object
- JavaScript Number Object
- JavaScript String Object
- JavaScript RegExp Object
- JavaScript Global Properties/Functions
- JavaScript Operators
- JavaScript Error
Browser Objects
DOM Objects
- HTML DOM Document Object
- HTML DOM Element Object
- HTML DOM Attribute Object
- HTML DOM Event Object
- HTML DOM Console Object
- CSSStyleDeclaration Object
- DOM HTMLCollection
HTML Objects
- <a>
- <area>
- <audio>
- <base>
- <blockquote>
- <body>
- <button>
- <canvas>
- <col>
- <colgroup>
- <datalist>
- <del>
- <details>
- <dialog>
- <embed>
- <fieldset>
- <form>
- <iframe>
- <frameset >
- <img>
- <ins>
- <input> - button
- <input> - checkbox
- <input> - color
- <input> - date
- <input> - datetime
- <input> - datetime-local
- <input> - email
- <input> - file
- <input> - hidden
- <input> - image
- <input> - month
- <input> - number
- <input> - range
- <input> - password
- <input> - radio
- <input> - reset
- <input> - search
- <input> - submit
- <input> - text
- <input> - time
- <input> - url
- <input> - week
- <keygen>
- <link>
- <label>
- <legend>
- <li>
- <map>
- <menu>
- <menuItem>
- <meta>
- <meter>
- <object>
- <ol>
- <optgroup>
- <option>
- <param>
- <progress>
- <q>
- <script>
- <select>
- <source>
- <style>
- <table>
- <td>
- <th>
- <tr>
- <textarea>
- <title>
- <time>
- <track>
- <video>
Map name Property
Example
Get the name of the image map:
var x = document.getElementById("planetmap").name;
The value of x will be:
planetmap
Definition and Usage
The name property is used to set or return the value of the name attribute of an image map.
The name property describes the name of the image map.
The name property is associated with the usemap attribute of the <img> tag to create a relationship between the image and the map.
Note: When the name attribute is set, you also need to set the usemap attribute of the <img> - if not set, the image and map elements are no longer associated (the clickable areas will no longer be clickable).
Note: In HTML5, the id attribute and the name attribute of the <map> element must have the same value (but cannot be null or empty).
Browser Support
The name property is supported by all major browsers.
Syntax
Return the name property:
mapObject.name
Set the name property:
mapObject.name=name
Property Values
| Value | Description |
|---|---|
| name | Specifies the name of the image map |
Technical Details
| Return Value: | A string, representing the name of the image map |
|---|
More Examples
Example
Change the name of the image map:
document.getElementById("planetmap").name = "newMapName";
Related Pages
HTML Reference: HTML <map> name Attribute
YouTip