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 on Trending Technologies
Technical articles with clear explanations and examples
What is horizontal rule in HTML Page?
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 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 MoreExecute a script when the element is being clicked in HTML?
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 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 Input Date name Property
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 MoreHow to specify the URL of the page the link goes to in HTML?
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 MoreHTML DOM Input Date max Property
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 MoreHow to use image height and width attribute in HTML Page?
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 MoreExecute a script each time the playback rate changes in HTML?
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 MoreHTML size Attribute
The size attribute in HTML controls the number of visible options displayed in a element. When the size is set to 1 or omitted, the select element appears as a dropdown list. When size is greater than 1, it displays as a list box showing multiple options simultaneously with a scrollbar if needed. Syntax Following is the syntax for the size attribute − Option 1 Option 2 Here, number is a positive integer representing the number of visible options. If the size attribute is not ...
Read More