Anchor Examples: HTML DOM Anchor Object – Properties and Methods – Javascript Anchor Examples
Get 5 Hours of FREE PREMIUM Videos:
LearnVisualStudio.NET Free Preview
“ I am a lifetime member of LearnVisualStudio.net and a Premium Plus member of dotNetVideos.net.
LearnVisualStudio.net is awesome because it grows in value each year as more videos are added.
dotNetVideos.net is also great because it focuses a lot on MS Certifications and practical interview questions.
”
- Wade Harvey (IdealProgrammer.com)
Anchor Examples: HTML DOM Anchor Object – Properties and Methods – Javascript Anchor Examples
Purpose: – Illustrates the JavaScript syntax for working with the Anchor Object. An anchor allows you to create a hyperlink to another document or to a different point in the same document. The href property allows an anchor to link to another document, and the name property allows the anchor to link to another point within the current document. There are two ways to find anchors in a document: 1) use getElementById(); or 2) search through the anchors() array in the document object.
Anchor Object Examples
| Standard Properties | |
| className | Allows you to access the class attribute of an element |
| dir | Allows you to access the direction of text |
| lang | Allows you to access to the language code for an element |
| title | Allows you to access an element's advisory title |
| Anchor Object Properties | |
| accessKey | Allows you to access a keyboard key to access a link |
| charset | Allows you to access the character-set of the linked resource |
| coords | Allows you to access a comma-separated list with coordinates of a link in an image-map |
| href | Allows you to access the URL of the hyperlink |
| hreflang | Allows you to access the language code of the linked resource |
| id | Allows you to access the id of a link |
| innerHTML | Allows you to access the text of a hyperlink |
| name | Allows you to access the name of a link |
| rel | Allows you to access the relationship between the current document and the target URL |
| rev | Allows you to access the relationship between the target URL and the current document |
| shape | Allows you to access the shape of a link in an image-map |
| tabIndex | Allows you to access the tab order for a link |
| target | Allows you to access the where to open a link |
| type | Allows you to access the MIME type of the linked resource |
| Anchor Object Methods | |
| blur() | Removes focus from the link |
| focus() | Sets the focus on the link |
Related posts:
- HTML DOM Document Object Collections, Properties, and Methods HTML DOM Document Object Examples for Collections, Properties, and Methods...
- A Tag Example – HTML Syntax – Anchor Examples A Tag Example - HTML Syntax - Anchor Examples...
- URL Example JavaScript (JS): HTML DOM Objects – Document Object Properties – URL Example JavaScript (JS) URL Example JavaScript (JS): HTML DOM Objects - Document Object...
- Referrer Example JavaScript (JS): HTML DOM Objects – Document Object Properties – Referrer Example JavaScript (JS) Referrer Example JavaScript (JS): HTML DOM Objects - Document Object...
- Title Example JavaScript (JS): HTML DOM Objects – Document Object Properties – Title Example JavaScript (JS) Title Example JavaScript (JS): HTML DOM Objects - Document Object...
Related posts brought to you by Yet Another Related Posts Plugin.














































Wonderful!