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
Set the language of the linked document in HTML
The hreflang attribute in HTML specifies the language of the linked document. This attribute helps search engines understand the language of the target page and assists browsers in providing appropriate language-based features to users. Syntax Following is the syntax for the hreflang attribute − Link Text The language-code follows the ISO 639-1 standard (two-letter language codes) and can optionally include a country code using ISO 3166-1 alpha-2 format. Common Language Codes Here are some commonly used language codes with the hreflang attribute − Language Code Language Example Usage ...
Read MoreHTML DOM Input Date min Property
The HTML DOM Input Date min property is used to get or set the minimum allowable date for an HTML input element of type "date". This property corresponds to the min attribute in the HTML and restricts users from selecting dates earlier than the specified minimum date. Syntax Following is the syntax for getting the min property − inputDateObject.min Following is the syntax for setting the min property − inputDateObject.min = "YYYY-MM-DD" Parameters The min property accepts a string value in the format YYYY-MM-DD, where each component represents − ...
Read MoreGet the HTTP header for the information of the content attribute in HTML
The http-equiv attribute in HTML is used within tags to simulate HTTP response headers. It provides metadata that would normally be sent by a web server, allowing you to control browser behavior and document properties directly from the HTML. The http-equiv attribute works in conjunction with the content attribute to specify both the header name and its value. This is particularly useful for setting refresh intervals, character encoding, cache control, and other HTTP-like directives. Syntax Following is the syntax for the http-equiv attribute − Where header-name is the HTTP header to ...
Read MoreHTML DOM Input Date Object
The HTML DOM Input Date Object represents an HTML element with type="date". This object provides a date picker interface that allows users to select a date from a calendar widget, and it offers various properties and methods for programmatic control. Syntax Following is the syntax to create an input date element using JavaScript − var dateObject = document.createElement("input"); dateObject.type = "date"; You can also access an existing input date element − var dateObject = document.getElementById("dateId"); Properties The Input Date Object supports the following properties − ...
Read MoreExecute a script when a mouse button is pressed down on an element in HTML?
The onmousedown attribute in HTML executes a script when a mouse button is pressed down on an element. This event fires before the onmouseup event and is useful for creating interactive elements that respond to mouse press actions. Syntax Following is the syntax for the onmousedown attribute − Content The script parameter contains JavaScript code or function calls to execute when the mouse button is pressed down. Basic Example Following example demonstrates the onmousedown attribute with color changes − onmousedown Example ...
Read MoreHTML autofocus Attribute
The autofocus attribute in HTML automatically sets focus to a form element when the page loads. This attribute causes the browser to immediately place the cursor in the specified element, making it ready for user input without requiring a mouse click or tab navigation. The autofocus attribute is a boolean attribute introduced in HTML5 and can be used with various form elements including , , , and . Syntax Following is the syntax for the autofocus attribute − The autofocus attribute can also be written as − ...
Read MoreDefine a scalar measurement within a known range in HTML
To define a scalar measurement within a known range or a fractional value, we use the tag in HTML. The tag represents a gauge that displays a value within a specific range, commonly used for disk usage, quiz scores, battery levels, or relevance of query results. The tag is not used to indicate progress bars. If you want to show progress or completion, use the tag instead. For best accessibility, it's recommended to use a tag or provide fallback text between the opening and closing tags. Syntax Following is the syntax ...
Read MoreExecute a script when the element gets focus in HTML?
The onfocus attribute in HTML executes a JavaScript function when an element receives focus. Focus occurs when a user clicks on an input field, tabs to it using the keyboard, or programmatically selects it. This attribute is commonly used with form elements like input fields, text areas, and select dropdowns. Syntax Following is the syntax for the onfocus attribute − The onfocus attribute accepts a JavaScript function call or inline JavaScript code that executes when the element gains focus. Example − Input Field Focus Following example demonstrates how to change the ...
Read MoreHTML DOM Input Date readOnly Property
The HTML DOM Input Date readOnly property is used to control whether a date input field can be modified by the user. When set to true, the date input becomes read-only and users cannot change its value, though it remains focusable and its value is still submitted with forms. Syntax Following is the syntax to get the readOnly property value − inputDateObject.readOnly Following is the syntax to set the readOnly property − inputDateObject.readOnly = booleanValue Property Values The readOnly property accepts the following boolean values − ...
Read MoreHow to set background color in HTML?
Setting the background color in HTML allows you to customize the appearance of your web page and create visually appealing layouts. In modern HTML5, background colors are set using CSS, either through inline styles or external stylesheets. Syntax Following is the basic syntax to set background color using the CSS background-color property − Alternatively, you can use CSS in the section − body { background-color: colorname; } Note − The bgcolor attribute was deprecated in HTML5. Always use the CSS background-color property instead. Setting ...
Read More