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
HTML Articles
Page 9 of 151
HTML DOM Input Week step Property
The HTML DOM Input Week step property sets or returns the legal number intervals for week input fields. This property determines how many weeks the user can step through when using the input controls (like arrow buttons or keyboard navigation). Syntax Following is the syntax for returning the step value − inputWeekObject.step Following is the syntax for setting the step value − inputWeekObject.step = number Parameters The number parameter accepts the following values − Value Description number A positive integer specifying ...
Read MoreHTML DOM Input Week value Property
The HTML DOM Input Week value property gets or sets the value of an HTML input element with type="week". This property returns a string in the format YYYY-WNN where YYYY is the year and NN is the week number (01-53). It allows JavaScript to programmatically read and modify week input values. Syntax Following is the syntax for getting the value − inputWeekObject.value Following is the syntax for setting the value − inputWeekObject.value = "YYYY-WNN" Parameters YYYY − A four-digit year (e.g., 2024) WNN − Week number from W01 ...
Read MoreHTML DOM InputEvent Object
The InputEvent Object in the HTML DOM represents events that occur when the content of a form element changes. This includes typing text, deleting content, pasting data, or any other modification to input elements like text fields, textareas, and content-editable elements. The InputEvent interface extends the UIEvent interface and provides detailed information about the type of input change that occurred, making it useful for creating responsive user interfaces and real-time validation. Properties and Methods The InputEvent object provides the following properties and methods − Property/Method Description data Returns the ...
Read MoreHTML DOM Kbd Object
The HTML DOM Kbd object represents the element in the document. The element is used to define keyboard input and displays text in a monospace font by default, indicating that the text represents user input from a keyboard. Syntax Following is the syntax to create a element using JavaScript − var kbdObject = document.createElement("KBD"); You can also access an existing element using − var kbdObject = document.getElementById("kbdId"); Properties The Kbd object inherits all the standard properties and methods from the HTMLElement interface. Common properties include ...
Read MoreHTML DOM KeyboardEvent charCode Property
The KeyboardEvent charCode property returns the Unicode character code of the character that was pressed during a keyboard event. It provides a numeric representation of the character, which can be useful for character validation and input processing. Note − The charCode property is deprecated. Use the key property instead for modern applications, as it provides more accurate and readable results. Syntax Following is the syntax for accessing the charCode property − event.charCode Return Value The charCode property returns a number representing the Unicode character code of the pressed key. For non-character keys ...
Read MoreHTML DOM KeyboardEvent code Property
The KeyboardEvent code property in HTML DOM returns a string representing the physical key that was pressed during a keyboard event. Unlike the key property which returns the logical key value, the code property represents the actual physical key location on the keyboard, making it useful for game controls and applications that need to detect specific key positions regardless of keyboard layout. Note − The code property is layout-independent, while the key property reflects the actual character typed. Use key for text input and code for physical key detection. Syntax Following is the syntax for accessing the ...
Read MoreHTML DOM KeyboardEvent getModifierState( ) Method
The getModifierState() method is a property of the KeyboardEvent interface that returns a boolean value indicating whether the specified modifier key was pressed when the keyboard event occurred. This method is essential for detecting the state of modifier keys like Ctrl, Alt, Shift, and CapsLock during user input. Syntax Following is the syntax for the getModifierState() method − event.getModifierState(keyArg) Parameters The method takes a single parameter − keyArg − A string representing the modifier key to check. The parameter is case-sensitive. Return Value The method returns a boolean ...
Read MoreHTML DOM KeyboardEvent key Property
The KeyboardEvent key property returns the identifier of the key that was pressed during a keyboard event. This property provides the actual value of the key, making it useful for detecting specific characters, special keys, and modifiers in web applications. Syntax Following is the syntax for accessing the key property − event.key Where event is the KeyboardEvent object passed to the event handler function. Return Value The key property returns a string representing the key that was pressed. The returned values include − Printable characters − Letters, numbers, symbols (e.g., ...
Read MoreHTML DOM KeyboardEvent keyCode Property
The KeyboardEvent keyCode property returns the numeric unicode character code for the key that was pressed during a keyboard event. This property has been deprecated in favor of the key property, but it is still widely used in legacy code and remains functional across browsers. Note − The keyCode property is deprecated. Use the key property instead for more accurate and readable results in modern applications. Syntax Following is the syntax for accessing the keyCode property − event.keyCode The event.keyCode returns a numeric value representing the key that was pressed. For example, the ...
Read MoreHTML DOM KeyboardEvent location Property
The HTML DOM KeyboardEvent location property returns a numeric value indicating the physical location of the pressed key on the keyboard. This property helps distinguish between keys that have the same keyCode but exist in different locations, such as left and right Shift keys. Syntax Following is the syntax for accessing the location property − event.location Return Values The property returns one of four possible numeric values representing different keyboard sections − Value Description 0 Standard keys (most keys on the keyboard including letters, numbers, ...
Read More