HTML | DOM Link rel Property Last Updated : 22 Aug, 2022 Comments Improve Suggest changes Like Article Like Report 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. Syntax: It returns the rel property.linkObject.relIt is used to set the rel property.linkObject.rel = relationship Property Values: 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 originhelp: It provides a help link.icon: It is used to import an icon to represent the document.license: It defines 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 navigationpreload: 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.Return value : It returns a string value, which representing a space-separated list of relationship types Example-1: This Example returns a rel Property. HTML <!DOCTYPE html> <html> <head> <link id="linkid" rel="stylesheet" type="text/css" href="styles.css" sizes="16*16"> </head> <body style="text-align:center;"> <h1>GeeksForGeeks</h1> <h2>DOM Link rel Property</h2> <button onclick="gfg()">Get URL </button> <p id="pid" style="font-size:25px; color:green;"> </p> <script> function gfg() { // Return Link rel Property var NEW = document.getElementById( "linkid").rel; document.getElementById( "pid").innerHTML = NEW; } </script> </body> </html> Output: Before Clicking On Button : After Clicking On Button : Example-2: This Example sets the rel Property. HTML <!DOCTYPE html> <html> <head> <link id="linkid" rel="stylesheet" type="text/css" href="styles.css" sizes="16*16"> </head> <body style="text-align:center;"> <h1>GeeksForGeeks</h1> <h2>DOM Link rel Property</h2> <button onclick="gfg()">Get URL </button> <p id="pid" style="font-size:25px; color:green;"> </p> <script> function gfg() { // Set Link rel Property var NEW = document.getElementById( "linkid").rel = "alternate"; document.getElementById( "pid").innerHTML = "The value of the rel attribute was changed to " + NEW; } </script> </body> </html> Output : Before Clicking On Button: After Clicking On Button: Supported Browsers: Google ChromeMozilla FirefoxEdgeSafariOpera Comment More infoAdvertise with us Next Article HTML | DOM Link rel Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Link type Property The DOM Link type Property is used to set or return the content type or MIME type of the linked Document. For eg. text/css", "text/javascript", "image/gif", etc. Syntax: It returns the type property.linkObject.typeIt is used to set the type property.linkObject.type = MIME-type Property Values: It co 1 min read HTML DOM URL Property The DOM URL property in HTML is used to return a string that contains the complete URL of the current document. The string also includes the HTTP protocol such as ( http://).Syntax:document.URLReturn Value: It returns a string value that represents the full URL of the document. Example: In this exam 2 min read HTML | DOM Link href Property The HTML | DOM Link href Property is used to set or return the URL of a Linked Document. Syntax: It return the href property.linkObject.hrefIt is used to Set the href property.linkObject.href = URL Property Values: It contains the value i.e URL which specify the URL of the link. absolute URL: It poi 2 min read HTML DOM Link media Property The HTML DOM link media property is used to set or return the value of the media attribute of an <link> element. The media attribute is used to specify what type of media devices the target resource is optimized. Syntax: It is used to return the media property. linkObject.media; It is used to 1 min read HTML DOM Input URL list Property The input URL list property in HTML DOM is used to return a reference to the datalist element that contains an input URL field. Syntax: urlObject.list.id Return Value: It returns a string value that represents the value of the id attribute of the datalist element. Example: Below HTML code is used to 1 min read HTML | DOM Input URL name Property The DOM Input URL name Property in HTML DOM is used to set or return the value of name attribute of a URL field. The name attribute is required for each input field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the 2 min read HTML | DOM Input URL type Property The DOM Input URL type Property in HTML DOM is used for returning the Which type of form element the URL field is. This Property will always return "URL".Syntax: urlObject.type Return Value: It returns a string value which represent the type of form element the URL field is. Example: This Example il 1 min read HTML DOM Anchor rel Property The Anchor rel Property in HTML DOM is used to set or return the value of the rel attribute of a link. The rel attribute is used to specify the relation between the current document and the linked document. Syntax: It returns the Anchor rel property. anchorObject.relIt is used to set the Anchor rel 2 min read HTML | DOM Input URL value Property The DOM Input URL value Property in HTML DOM is used to set or return the value of the input URL field. The attribute specifies the default value or the user type value. Syntax: It returns the value property.urlObject.valueIt is used to set the value property.urlObject.value = url Property Values: I 2 min read HTML | DOM Link hreflang Property The DOM Link hreflang Property is used to set or return the value of the hreflang attribute of a linked document. The hreflang attribute is used to specify the language for a linked document. Syntax: It return the hreflang property.linkObject.hreflangIt is used to set the hreflang property.linkObjec 2 min read Like