The Input Date form property returns a reference to the form element that contains the input date field. This property is read-only and provides access to the enclosing form object, allowing you to retrieve form attributes like ID, action, or method through JavaScript. Syntax Following is the syntax for accessing the form property − inputDateObject.form Return Value The form property returns a reference to the form element that contains the input date field. If the input date is not inside a form, it returns null. Example − Getting Form Reference Following ... Read More
The tag in HTML creates a horizontal rule that serves as a visual separator between content sections on a web page. It displays as a horizontal line and is most commonly used to divide content thematically, making the page structure clearer and more readable. The tag is a self-closing element in HTML, meaning it doesn't require a closing tag. It creates a thematic break in the content flow and is rendered as a horizontal line by default. Syntax Following is the syntax for the tag − The tag ... Read More
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 More
Use the onclick attribute to execute a script when an element is clicked in HTML. The onclick attribute allows you to run JavaScript functions directly when a user interacts with elements like buttons, links, divs, or any clickable HTML element. Syntax Following is the syntax for the onclick attribute − Content You can also execute JavaScript code directly within the onclick attribute − Content Using onclick with Button Elements Example − Basic onclick Function Following example demonstrates how to use the onclick attribute to execute a JavaScript function ... Read More
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 More
The HTML DOM Input Date name property gets or sets the value of the name attribute for an HTML element. This property is essential for identifying form data when submitted to a server, as the name serves as the key in name-value pairs. Syntax Following is the syntax to get the name attribute value − inputDateObject.name Following is the syntax to set the name attribute value − inputDateObject.name = "newName" Parameters newName − A string value representing the new name for the input date element. ... Read More
The href attribute in HTML is used to specify the URL of the page that a link should navigate to. The href attribute is primarily used with the (anchor) tag to create hyperlinks that allow users to navigate between web pages or different sections within the same page. Syntax Following is the syntax for using the href attribute with anchor tags − Link Text The URL can be an absolute URL, relative URL, or an anchor link to a section within the same page. Types of URLs in href Attribute The ... Read More
The HTML DOM Input Date max property is used to set or return the value of the max attribute of an input element with type="date". This property defines the maximum date that users can select in a date picker, helping to create date range restrictions in forms. Syntax Following is the syntax for returning the max value − inputDateObject.max Following is the syntax for setting the max value − inputDateObject.max = "YYYY-MM-DD" Parameters The max property accepts a string value in the format YYYY-MM-DD representing the maximum selectable date. ... Read More
Images make web content more engaging and help users better understand the information presented. In HTML, we can control the display size of images using the width and height attributes of the tag. The tag is a self-closing element that requires the src attribute to specify the image location. The width and height attributes allow us to define the display dimensions of the image without modifying the original file. Syntax Following is the syntax for using width and height attributes with the image tag − The width and height values ... Read More
The onratechange event attribute in HTML executes a JavaScript function whenever the playback rate of an audio or video element changes. This event is particularly useful for creating custom media controls or displaying the current playback speed to users. Syntax Following is the syntax for the onratechange attribute − ... ... The onratechange attribute can be used with both and elements. The function specified will execute each time the playbackRate property changes. Playback Rate Property The playbackRate property controls the speed at which media content plays − 1.0 ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Economics & Finance