Front End Technology Articles

Page 8 of 652

HTML DOM Legend Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 182 Views

The HTML DOM Legend Object represents the element in the Document Object Model. The element provides a caption or title for its parent element, helping to group related form controls together with a descriptive label. Syntax Following is the syntax for creating a element using JavaScript − var legendObject = document.createElement("LEGEND"); To access an existing element − var legendObject = document.getElementById("legendId"); Properties The Legend Object has the following property − Property Description form Returns a reference ...

Read More

HTML DOM li Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 218 Views

The HTML DOM Li Object represents the (list item) element in the Document Object Model. This object provides properties and methods to manipulate list items dynamically using JavaScript. Accessing Li Objects You can access existing elements using various DOM methods − // Get li element by ID var liElement = document.getElementById("myListItem"); // Get all li elements var allLiElements = document.getElementsByTagName("li"); // Get li elements by class name var liByClass = document.getElementsByClassName("list-item"); Creating Li Objects Following is the syntax to create a new element − var liObject ...

Read More

HTML DOM Link href Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 319 Views

The HTML DOM Link href property is used to set or return the URL/path of a linked document. This property is commonly used with elements to dynamically change stylesheets, favicons, or other linked resources on a webpage. Syntax Following is the syntax for getting the href attribute value − linkObject.href Following is the syntax for setting the href attribute value − linkObject.href = string Parameters The string parameter can be the following values − Value Type Description Absolute path It ...

Read More

HTML DOM Link rel Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 178 Views

The HTML DOM Link rel property sets or returns the relationship between the current document and the linked document. This property corresponds to the rel attribute of the element and specifies how the linked resource relates to the current document. Syntax Following is the syntax for getting the rel attribute value − linkObject.rel Following is the syntax for setting the rel attribute to a value − linkObject.rel = valueString Parameters valueString − A string that specifies the relationship between the current document and the linked document. It can ...

Read More

HTML DOM Local Storage clear() method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 354 Views

The HTML DOM Local Storage clear() method removes all key-value pairs from the localStorage object for the current domain. This method provides a quick way to empty the entire local storage without removing items individually. Syntax Following is the syntax for the localStorage clear() method − localStorage.clear() For sessionStorage, the syntax is − sessionStorage.clear() Parameters The clear() method does not accept any parameters. Return Value The method returns undefined and does not provide any return value. How It Works When localStorage.clear() is called, it removes ...

Read More

HTML DOM Location host Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 204 Views

The HTML DOM Location host property returns or sets the hostname and port number of the current URL. This property combines both the hostname (like www.example.com) and port number (like 8080) in the format hostname:port. If no port is specified in the URL, only the hostname is returned. Syntax Following is the syntax for getting the host property − location.host Following is the syntax for setting the host property − location.host = "hostname:port" Return Value The location.host property returns a string containing the hostname and port number. If the ...

Read More

HTML DOM Location href Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 214 Views

The HTML DOM Location href property returns or sets the complete URL of the current page. This property provides access to the entire URL including protocol, hostname, port, path, search parameters, and fragment identifier. Syntax Following is the syntax for getting the href property − location.href Following is the syntax for setting the href property − location.href = "URL" Parameters The location.href property accepts the following parameter when setting a value − URL − A string representing the complete URL to navigate to. This can be an ...

Read More

HTML DOM Location search Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 204 Views

The Location search property returns or sets the query string portion of a URL, including the leading question mark (?). This property allows you to read the search parameters from the current URL or programmatically modify them. Syntax Following is the syntax for getting the search property − location.search Following is the syntax for setting the search property − location.search = searchString Parameters searchString − A string representing the query parameters, including the leading question mark. For example: "?name=john&age=25" Return Value Returns a string containing the query ...

Read More

HTML DOM Anchor rel Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 203 Views

The HTML DOM Anchor rel property returns or sets the rel attribute of an anchor element. The rel attribute specifies the relationship between the current document and the linked document, providing semantic meaning to links for browsers, search engines, and assistive technologies. Syntax Following is the syntax to return the rel property − anchorObject.rel Following is the syntax to set the rel property − anchorObject.rel = "value" Parameters The value parameter accepts a string containing one or more space-separated link types. Common values include − nofollow − ...

Read More

HTML DOM Anchor search Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 189 Views

The HTML DOM Anchor search property returns or sets the query string part of an anchor element's href attribute. The query string is the portion of a URL that comes after the question mark (?) and contains parameters passed to the server, typically used in GET requests. Syntax Following is the syntax for returning the search property − anchorObject.search Following is the syntax for setting the search property − anchorObject.search = querystring Parameters querystring − A string representing the query string portion of the URL, including the ...

Read More
Showing 71–80 of 6,519 articles
« Prev 1 6 7 8 9 10 652 Next »
Advertisements