Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
HTML DOM Anchor rel Property
The HTML DOM Anchor Rel property returns the rel attribute of a link. The rel attribute describes the association between the running document and the linked document.
Syntax
Following is the syntax to ?
a) Return the rel property ?
anchorObject.rel
b) Set the rel property &minus
anchorObject.rel = "value"
Example
Let us see an example of the HTML DOM anchor rel property ?
Example
Click on the button
Output
This will produce the following output ?

Click on the "Click me!" button to get the HTML DOM Anchor rel property ?

In the above example ?
We have taken an anchor tag with rel property used for specifying the type of relation to the linked document which in the above code is https://www.examplesite.com/
We have then created a button named "Click Me" to execute the display function ?
The display function gets the rel property of the element with id=" Anchor example" ?
function display() {
var docs = document.getElementById("anchorExample").rel;
document.getElementById("show").innerHTML = docs;
}
We have then created a button named "Click Me" to execute the display function ?
