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
-
Economics & Finance
Articles by Ankith Reddy
Page 14 of 73
HTML DOM Anchor password Property
The HTML DOM Anchor password property sets or returns the password portion of an anchor element's href attribute value. This property is part of the URL structure that includes user credentials in the format https://username:password@hostname.com. Syntax To set the password property − anchorObject.password = "newPassword" To return the password property − anchorObject.password Return Value The password property returns a string representing the password part of the URL. If no password is specified in the href attribute, it returns an empty string. Example − Getting Anchor Password Following ...
Read MoreHTML href Attribute
The href attribute in HTML is used to specify the URL or path to a linked resource. It is most commonly used with anchor tags () to create hyperlinks, and with elements to reference external stylesheets, favicons, and other resources. Syntax Following is the syntax for the href attribute − Link text Here, url can be an absolute URL, relative path, or fragment identifier pointing to the target resource or location. Using href with Anchor Tags The most common use of the href attribute is with anchor tags to create ...
Read MoreHTML value Attribute
The value attribute in HTML specifies the current value for various form elements and meters. It serves different purposes depending on the element type − for form inputs, it sets the default or current value that appears in the field, while for the element, it represents the current measurement within a defined range. Syntax Following is the syntax for the value attribute − Click Me The value can be text, numbers, or other data types depending on the element and input type being used. Value Attribute with Input Elements ...
Read MoreHTML max Attribute
The max attribute in HTML defines the maximum value for various form input elements and the progress element. It specifies the upper limit or boundary for user input and progress indicators, ensuring data validation and proper visual representation. Syntax Following is the syntax for the max attribute − Where value represents the maximum allowed value. The data type depends on the element type (number, date, or floating-point). Elements Supporting Max Attribute The max attribute can be used with the following HTML elements − − Sets the maximum numeric ...
Read MoreCreate a command/menu item that the user can invoke from a popup menu in HTML5
The tag in HTML5 was designed to create command/menu items that users can invoke from popup context menus. However, it's important to note that this element has been deprecated and is no longer supported in modern browsers due to lack of widespread adoption and implementation inconsistencies. The tag was intended to work with the element to create interactive context menus that would appear when users right-clicked on elements with a contextmenu attribute. Syntax Following is the syntax for the deprecated tag − Attributes ...
Read MoreHTML DOM Anchor origin Property
The HTML DOM Anchor origin property returns a string containing the protocol, hostname, and port number of a URL. This is a read-only property that provides the origin portion of the anchor element's href attribute value. Syntax Following is the syntax for the Anchor origin property − anchorElement.origin Return Value The origin property returns a string representing the origin of the URL, which includes − Protocol − The scheme part (http:, https:, ftp:, etc.) Hostname − The domain name or IP address Port − The port number (if explicitly specified) ...
Read MoreHTML DOM Anchor port Property
The HTML DOM Anchor port property is used to set or return the port number of a URL in the href attribute of an anchor element. This property represents the port number portion of the URL, which appears after the hostname and is separated by a colon. Syntax Following is the syntax to set the port property − anchorObj.port = portNumber Following is the syntax to return the port property − anchorObj.port Here, portNumber is a string representing the port number of the URL. If no port is specified in ...
Read MoreHow do I add a simple onClick event handler to an HTML5 canvas element?
The HTML5 canvas element creates a drawing surface where shapes and graphics are rendered as pixels, not DOM elements. Unlike regular HTML elements, canvas drawings have no built-in click detection. To handle click events on canvas shapes, you must capture clicks on the canvas element itself and calculate which drawn shape was clicked based on coordinates. Syntax Following is the syntax to add a click event listener to a canvas element − canvas.addEventListener('click', function(event) { // Handle click event }, false); How Canvas Click Detection Works Canvas click detection involves ...
Read MoreHTML rel Attribute
The rel attribute of the element specifies the relationship between the current document and the linked document. This attribute was introduced in HTML5 for the element and helps define the semantic relationship between clickable regions in image maps and their target destinations. Syntax Following is the syntax for the rel attribute in the element − The value can be one or more space-separated keywords that define the relationship type. Rel Attribute Values The rel attribute accepts the following values that define different types of relationships − ...
Read MoreHow do we specify that the audio/video will start playing as soon as it is ready in HTML?
The autoplay attribute in HTML specifies that audio or video content should start playing automatically as soon as it is ready, without requiring user interaction. This attribute is a boolean attribute that can be applied to both and elements. Syntax Following is the syntax for the autoplay attribute − ... ... The autoplay attribute can also be written with an explicit value − ... Video Autoplay Example Following example demonstrates how to use the autoplay attribute with a video element − ...
Read More