The HTML DOM option text property allows you to retrieve and modify the text content of an element within a dropdown. This property is useful for dynamically updating option labels without recreating the entire select element. Syntax Following is the syntax for getting the text value − optionElement.text Following is the syntax for setting the text value − optionElement.text = "newText" Return Value The property returns a string representing the text content of the option element. When setting, it accepts a string value that becomes the new ... Read More
The HTML DOM Input Email autofocus property controls whether an email input field automatically receives focus when the page loads. This property corresponds to the HTML autofocus attribute and can be both read and modified using JavaScript. Syntax Following is the syntax for getting the autofocus property value − inputEmailObject.autofocus Following is the syntax for setting the autofocus property − inputEmailObject.autofocus = booleanValue Parameters The booleanValue parameter accepts the following values − Value Description true The email input field will be ... Read More
The novalidate attribute in HTML is a Boolean attribute that disables the browser's built-in form validation when a form is submitted. When applied to a element, it allows users to submit forms even if the input fields contain invalid data according to their validation constraints. By default, HTML5 provides automatic client-side validation for various input types such as email, number, url, and attributes like required, pattern, min, and max. The novalidate attribute overrides this behavior. Syntax Following is the syntax for using the novalidate attribute − ... Read More
The onmouseover attribute in HTML triggers when a mouse pointer moves over an element. This event is commonly used to create interactive effects such as changing colors, displaying tooltips, or showing additional content when users hover over elements. Syntax Following is the syntax for the onmouseover attribute − Content The script parameter contains JavaScript code that executes when the mouse pointer enters the element's area. Basic Onmouseover Example Following example demonstrates how to change text color when hovering over a heading − Onmouseover Example ... Read More
The cite attribute in HTML provides a URL reference that explains why specific content was deleted or inserted. It is commonly used with the and elements to document the reason for changes made to the content. Syntax Following is the syntax for the cite attribute with the element − deleted content Following is the syntax for the cite attribute with the element − inserted content Here, url is the link that points to a document or resource explaining why the text was deleted or inserted. ... Read More
The HTML DOM Input Email defaultValue property sets or returns the default value of an email input field. This property corresponds to the value attribute in the HTML markup. Unlike the current value property which changes as the user types, the defaultValue remains constant and represents the original value specified in the HTML. Syntax Following is the syntax for returning the default value − inputEmailObject.defaultValue Following is the syntax for setting the default value − inputEmailObject.defaultValue = "string" Parameters The defaultValue property accepts a string parameter that represents the ... Read More
The onpause attribute in HTML is an event handler that triggers when a media element (audio or video) is paused, either by user interaction or programmatically through JavaScript. This attribute allows you to execute custom JavaScript functions when the media playback is paused. Syntax Following is the syntax for the onpause attribute − Following is the syntax for programmatic usage − element.onpause = function() { /* code */ }; Using onpause with Video Element The onpause attribute is commonly used with and ... Read More
The HTML DOM Input Email disabled property sets or returns whether an Input Email field is enabled or disabled. When set to true, the email input becomes non-interactive and its value cannot be modified by the user. Syntax Following is the syntax for returning the disabled property value − inputEmailObject.disabled Following is the syntax for setting the disabled property − inputEmailObject.disabled = booleanValue Property Values The disabled property accepts the following boolean values − Value Description true The input email field ... Read More
The border-spacing CSS property adds space between table cells by controlling the distance between adjacent cell borders. This property only works on tables that use the separated borders model (the default), not on tables with collapsed borders. Syntax Following is the syntax for adding space around table border in HTML − border-spacing: value; The border-spacing property accepts the following values − Single value − Sets equal horizontal and vertical spacing (e.g., border-spacing: 10px;) Two values − Sets horizontal and vertical spacing separately (e.g., border-spacing: 10px 5px;) Units − Accepts pixels (px), ems ... Read More
The formnovalidate attribute in HTML is a boolean attribute that disables form validation for a specific submit button. When applied to a submit button, it overrides the form's validation requirements, allowing the form to be submitted without validating any required fields or input constraints. This attribute is particularly useful when you have multiple submit buttons in a form and want some buttons to bypass validation (such as "Save as Draft" or "Cancel" buttons) while others enforce validation (like "Submit" buttons). Syntax Following is the syntax for the formnovalidate attribute − Submit The ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Economics & Finance