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 by AmitDiwan
Page 269 of 840
HTML DOM Textarea required Property
The HTML DOM Textarea required property sets or returns whether a textarea field must be filled out before submitting a form. When set to true, the textarea becomes a mandatory field, and the browser will prevent form submission if it's empty. Syntax Following is the syntax for returning the required property − textareaObject.required Following is the syntax for setting the required property − textareaObject.required = true | false Property Values The required property accepts the following values − true − The textarea field is required and must ...
Read MoreHTML DOM Textarea maxLength Property
The HTML DOM Textarea maxLength property allows you to get or set the maximum number of characters that can be entered in a textarea element. This property corresponds to the maxlength attribute in HTML and helps control user input length. Syntax Following is the syntax to return the maxLength value − object.maxLength Following is the syntax to set the maxLength value − object.maxLength = number Here, object refers to the textarea element, and number is a positive integer representing the maximum allowed characters. Return Value The maxLength property ...
Read MoreHTML DOM Textarea select() Method
The HTML DOM Textarea select() Method selects all the content within a textarea element programmatically. This method is commonly used to highlight text for copying or to provide a convenient way for users to select all text at once. Syntax Following is the syntax for the textarea select() method − textareaObject.select() Parameters The select() method does not take any parameters. Return Value The select() method does not return any value. It simply selects all the text content within the textarea element. Example − Basic Textarea Selection Following example demonstrates ...
Read MoreHTML DOM Input Submit object property
The HTML DOM Input Submit object is associated with the element with type="submit". We can create and access an input element with type submit by using the createElement() method and getElementById() method respectively. The Input Submit object represents a submit button in HTML forms, which is used to submit form data to the server when clicked. This object provides various properties to control the behavior and appearance of the submit button. Syntax Following is the syntax for creating an input submit object − var submitButton = document.createElement("INPUT"); submitButton.setAttribute("type", "submit"); Following is the ...
Read MoreHTML DOM Input Submit type Property
The HTML DOM Input Submit type property is associated with input elements having type="submit". This property is read-only and always returns the string "submit" for submit button elements. It helps identify the type of input element programmatically in JavaScript. The submit type property is useful when you need to verify or distinguish between different input types in forms, especially when working with multiple input elements dynamically. Syntax Following is the syntax for the submit type property − submitObject.type Return Value The property returns a string value "submit" representing the type of the ...
Read MoreHTML DOM Meter optimum Property
The HTML DOM Meter optimum property gets or sets the optimum value of a element. This property specifies what value is considered the best or most desirable within the meter's range. The optimum value works together with the high, low, min, and max attributes to determine the meter's visual appearance and semantic meaning. Note: The element should be used as a gauge to display scalar measurements within a known range, not as a progress bar. For progress indication, use the element instead. Syntax To get the optimum value − meterElementObject.optimum ...
Read MoreHTML DOM Input Submit value Property
The HTML DOM Input Submit value property is associated with the input element having type="submit" and the value attribute. It is used to return the value of the submit button's value attribute or to set it. The value property for submit button changes the text displayed on the button, as by default the text is "Submit". Syntax Following is the syntax for getting the value property − var buttonText = submitObject.value; Following is the syntax for setting the value property − submitObject.value = text; Here, text is a string specifying ...
Read MoreHTML DOM Meter value Property
The HTML DOM Meter value property returns or sets the current value of a element. This property corresponds to the value attribute and represents the actual measurement within the defined range. The element should be used as a gauge to display scalar measurements within a known range, not as a progress bar. Note: The element is specifically designed for displaying measurements like disk usage, temperature, or scores. For progress indicators, use the element instead. Syntax Following is the syntax to get the value property − meterElementObject.value Following is the ...
Read MoreHTML DOM HashChangeEvent
The HTML DOM HashChangeEvent is an interface that represents events fired when the hash portion (fragment identifier) of a URL changes. This event occurs when the part of the URL after the # symbol is modified, either programmatically through JavaScript or by user interaction with anchor links. The HashChangeEvent is commonly used in single-page applications (SPAs) for client-side routing and navigation without full page reloads. Syntax Following is the syntax for accessing HashChangeEvent properties − event.newURL event.oldURL The event is typically handled using the onhashchange event handler − window.addEventListener('hashchange', function(event) { ...
Read MoreHTML DOM MouseEvent clientX Property
The HTML DOM MouseEvent clientX property returns the horizontal coordinate (x-axis position) of the mouse pointer relative to the visible area of the web browser when a mouse event occurs. The coordinate is measured in pixels from the left edge of the browser's client area, excluding scrollbars, toolbars, and other browser interface elements. Syntax Following is the syntax for accessing the clientX property − MouseEventObject.clientX Return Value The clientX property returns a number representing the horizontal pixel coordinate of the mouse pointer. The value is always relative to the current viewport, not the ...
Read More