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
How to add a container for an external (non-HTML) application in HTML5
To add a container for an external application in HTML5, we use the tag. It defines a container for an external resource like web pages, media players, pictures, or plug-in applications. The embed element is a self-closing tag that provides a generic way to include external content when more specific HTML5 elements are not suitable. Syntax Following is the basic syntax for the embed tag in HTML − The tag is self-closing and does not require a closing tag. It supports global and event attributes in HTML5. Attributes The ...
Read MoreExecute a script when the document is about to be unloaded in HTML?
The onbeforeunload event attribute in HTML fires when the document is about to be unloaded, such as when a user closes the browser tab, navigates away from the page, or refreshes it. This event is commonly used to warn users about unsaved changes or to perform cleanup operations before the page is destroyed. Syntax Following is the syntax for the onbeforeunload event attribute − The event handler function can return a string message that will be displayed in the browser's confirmation dialog. However, modern browsers may show their own generic message instead of ...
Read MoreHTML DOM Input Color autofocus Property
The HTML DOM Input Color autofocus property sets or returns whether a color input field automatically receives focus when the page loads. When set to true, the color input will be highlighted and ready for user interaction immediately upon page load. Syntax Following is the syntax for returning the autofocus property value − inputColorObject.autofocus Following is the syntax for setting the autofocus property − inputColorObject.autofocus = booleanValue Parameters The booleanValue parameter can be one of the following − Value Description true ...
Read MoreExecute a script when there have been changes to the anchor part of the URL in HTML?
The onhashchange event in HTML executes a script whenever the anchor part (hash fragment) of the URL changes. The anchor part refers to the portion of the URL that comes after the # symbol, commonly used for navigation within a page or single-page applications. This event is particularly useful for detecting when users navigate using the browser's back/forward buttons or when the URL hash is programmatically modified. The hash change can be detected using either the onhashchange attribute or JavaScript event listeners. Syntax Following is the syntax for the onhashchange attribute − ...
Read MoreHTML DOM Input Color defaultValue Property
The HTML DOM Input Color defaultValue property sets or returns the default value of a color input field. This property represents the initial value specified in the HTML value attribute, which may differ from the current value if the user has changed the color selection. Syntax Following is the syntax for getting the default value − inputColorObject.defaultValue Following is the syntax for setting the default value − inputColorObject.defaultValue = "colorValue" Parameters The defaultValue property accepts a string parameter representing a valid hexadecimal color value − ...
Read MoreInclude information about the document in HTML
Use the tag to include information about the document. The HTML element contains metadata and other information about the document that is not displayed directly in the browser window. This section provides essential information to browsers, search engines, and other web services about your HTML document. Syntax Following is the basic syntax for the element − Common Elements in the Head Section The section typically contains several important elements − − Defines the document title shown in the browser tab ...
Read MoreHTML DOM Input Color form Property
The Input Color form property in HTML DOM returns a reference to the form element that contains the color input. This read-only property is useful for accessing the parent form of a color input element programmatically. Syntax Following is the syntax for accessing the form property − inputColorObject.form Return Value The form property returns a reference to the HTMLFormElement object that contains the color input. If the input is not inside a form, it returns null. Example − Getting Form Reference Following example demonstrates how to get the form reference of ...
Read MoreHTML DOM Input Color name Property
The HTML DOM Input Color name property gets or sets the value of the name attribute for an input color element. The name attribute is crucial for form submission, as it identifies the color input field when the form data is sent to the server. Syntax Following is the syntax for getting the name property − inputColorObject.name Following is the syntax for setting the name property − inputColorObject.name = "string" Return Value The name property returns a string representing the value of the name attribute of the input color ...
Read MoreAdd a horizontal rule in HTML
The tag in HTML creates a horizontal rule that defines a thematic break in an HTML page. It is commonly used to visually separate content sections or indicate a change in topic within a document. The tag is a self-closing element that requires no closing tag. Syntax Following is the basic syntax for the tag − In modern HTML5, the tag is styled using CSS rather than HTML attributes. However, for compatibility, some legacy attributes are still recognized − Legacy Attributes The following ...
Read MoreHow do we set the type of element in HTML?
In HTML, the type attribute is used to specify the type or behavior of various HTML elements. This attribute is essential for defining how elements should function and what kind of content they handle. The type attribute is commonly used with form elements like and , as well as multimedia and resource elements. The type attribute serves different purposes depending on the element − Form elements − Defines the input type or button behavior Script elements − Specifies the scripting language or MIME type Media elements − Indicates the media format or MIME type Link elements ...
Read More