HTML | DOM Link rel Property
The HTML | DOM Link rel Property in HTML DOM is used to set or return the value of the rel attribute of a linked document. The rel attribute is used to specify the relation between the current document and the linked document.
- It returns the rel property.
- It is used to set the rel property.
linkObject.rel = relationship
- alternate: It defines an alternate version of the document i.e. print page, translated or mirror.
- author: It defines the author of the document.
- dns-prefetch: It is used to specify that the browser should preemptively perform DNS resolution for the target resource’s origin
- help: It provides a help link.
- icon: It is used to import an icon to represent the document.
- licence: It defines a copyright information for the document.
- next: It provides a link to the next document in a selection.
- pingback: It is used to provides the address of pingback server which is used to handle pingbacks of the current document.
- preconnect: It is used to specifies that the browser should preemptively connect to the target resource’s origin.
- prefetch: It is used to specifies that the browser should preemptively fetch and cache the target resource, it is likely to be required for follow-up navigation
- preload: It is used to specify the browser agent must preemptively fetch and cache the target resource for current navigation according to the destination which is given by the “as” attribute.
- prev: It specify the previous document in a selection.
- search: It specify a link search through the document.
- stylesheet:It is to import the style sheet.
Example-1: This Example returns a rel Property.
Before Clicking On Button :
After Clicking On Button :
Example-2: This Example sets the rel Property.
Before Clicking On Button:
After Clicking On Button:
- Google Chrome
- Mozilla Firefox
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.