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 karthikeya Boyini
Page 36 of 142
HTML DOM Input Number Object
The HTML DOM Input Number Object represents an element with type="number". This object provides properties and methods to interact with number input fields programmatically through JavaScript. The Input Number Object is useful for creating dynamic forms, validating numeric input, and implementing custom number controls with step increment/decrement functionality. Syntax You can create an Input Number Object in two ways − Creating a new Input Number element: var numberInput = document.createElement("INPUT"); numberInput.setAttribute("type", "number"); Accessing an existing Input Number element: var numberInput = document.getElementById("myNumber"); Properties The Input Number ...
Read MoreHTML DOM Input Number stepUp() Method
The HTML DOM Input Number stepUp() method is used to increment the value of a number input field by a specified amount. This method provides a programmatic way to increase numeric values, which is particularly useful for creating custom increment controls or automated value adjustments. Syntax Following is the syntax for the stepUp() method − numberInputObject.stepUp(stepValue) Parameters The stepUp() method accepts the following parameter − stepValue (optional) − A number specifying how much to increment the input value. If omitted, the default value is 1. Return Value This ...
Read MoreHTML DOM Input Number required Property
The HTML DOM Input Number required property sets or returns whether a number input field must be filled out before submitting the form. This property corresponds to the HTML required attribute and enables client-side form validation. Syntax Following is the syntax for returning the required property − object.required Following is the syntax for setting the required property − object.required = true | false Property Values The required property accepts the following boolean values − true − The number input field is required and must be filled before ...
Read MoreHTML DOM Input Number placeholder Property
The HTML DOM Input Number placeholder property returns and modifies the value of the placeholder attribute of a number input field. The placeholder provides a hint to the user about what kind of value is expected in the input field. Syntax Following is the syntax for returning the placeholder value − object.placeholder Following is the syntax for modifying the placeholder value − object.placeholder = "text" Parameters text − A string that specifies the placeholder text to display in the number input field. Return Value The ...
Read MoreHTML DOM Input Number step Property
The HTML DOM Input Number step property sets and retrieves the value of the step attribute for number input fields. The step attribute defines the legal number intervals for the input field, controlling how much the value increases or decreases when using the input's increment/decrement arrows. Syntax Following is the syntax for getting the step value − object.step Following is the syntax for setting the step value − object.step = "number" Parameters The step property accepts a string that represents a positive number. Common values include: "1" ...
Read MoreHTML DOM Select Object
The HTML DOM select object represents the element in an HTML document. This object provides properties and methods to dynamically create, manipulate, and interact with dropdown lists using JavaScript. Syntax To create a new select element using JavaScript − document.createElement("SELECT"); To access an existing select element − document.getElementById("selectId"); document.getElementsByTagName("select")[0]; document.querySelector("select"); Properties Following are the key properties of the select object − Property Description autofocus Returns or sets whether the dropdown should automatically get focus when the page loads. ...
Read MoreHTML DOM Select disabled Property
The HTML DOM select disabled property is used to get or set whether a dropdown list is disabled or enabled. When a select element is disabled, users cannot interact with it, and it appears grayed out in most browsers. Syntax Following is the syntax for getting the disabled property − object.disabled Following is the syntax for setting the disabled property − object.disabled = true | false Return Value The disabled property returns a Boolean value − true − The select element is disabled false ...
Read MoreHTML DOM Select length Property
The HTML DOM select length property returns the number of elements inside a drop-down list. This read-only property is useful for dynamically counting options in a select element without manually iterating through them. Syntax Following is the syntax for the select length property − selectObject.length Return Value The length property returns a number representing the total count of elements within the select element. If no options are present, it returns 0. Example − Basic Usage Following example demonstrates how to get the number of options in a select element ...
Read MoreHTML DOM Select type Property
The HTML DOM Select type property is a read-only property that returns the type of form control for a select element. For HTML elements, this property always returns "select-one" for single-selection dropdowns or "select-multiple" for multi-selection lists. Syntax Following is the syntax for accessing the type property − selectObject.type Return Value The type property returns a string value − "select-one" − For single-selection dropdown lists (default behavior) "select-multiple" − For multi-selection lists (when multiple attribute is present) Example − Single Selection Dropdown Following example demonstrates the type ...
Read MoreHTML DOM Select size Property
The HTML DOM select.size property returns and modifies the value of the size attribute of a dropdown list. This property controls how many options are visible at once in the select element without scrolling. Syntax Following is the syntax for returning the size value − selectObject.size Following is the syntax for setting the size value − selectObject.size = number Parameters The size property accepts the following parameter − number − A positive integer that specifies how many options should be visible in the dropdown list without scrolling. ...
Read More