Web Development Articles

Page 7 of 801

HTML DOM Input Week defaultValue Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 185 Views

The HTML DOM Input Week defaultValue property sets or returns the default value of a week input field. This property represents the original value attribute specified in the HTML, which remains constant even when the user changes the input field's current value. It is useful for resetting the field back to its original state. Syntax Following is the syntax for returning the default value − inputWeekObject.defaultValue Following is the syntax for setting the default value − inputWeekObject.defaultValue = "string" Parameters The defaultValue property accepts a string parameter representing a ...

Read More

HTML DOM Input Week Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 176 Views

The HTML DOM Input Week Object represents an HTML input element with type week. This object allows users to select a specific week and year, providing methods and properties for manipulating week-based form inputs programmatically. Syntax Following is the syntax to create an input element with type week using JavaScript − var weekObject = document.createElement("INPUT"); weekObject.type = "week"; You can also access an existing week input element − var weekObject = document.getElementById("weekId"); Properties The Input Week Object supports the following properties − Property Description ...

Read More

HTML DOM Input Week step Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 185 Views

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 More

HTML DOM Input Week value Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 188 Views

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 More

HTML DOM InputEvent Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 267 Views

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 More

HTML DOM Kbd Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 157 Views

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 More

HTML DOM KeyboardEvent charCode Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 166 Views

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 More

HTML DOM KeyboardEvent code Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 144 Views

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 More

HTML DOM KeyboardEvent getModifierState( ) Method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 265 Views

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 More

HTML DOM KeyboardEvent key Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 139 Views

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 More
Showing 61–70 of 8,010 articles
« Prev 1 5 6 7 8 9 801 Next »
Advertisements