DOM Articles

Page 3 of 4

HTML ondblclick Event Attribute

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 241 Views

The HTML ondblclick attribute is an event handler that triggers when a user double-clicks on an HTML element. This attribute allows you to execute JavaScript code in response to the double-click mouse event. Syntax Following is the syntax for using the ondblclick attribute − Content Parameters script − The JavaScript code to execute when the element is double-clicked. This can be a function call or inline JavaScript statements. Example − Button Double-Click Following example demonstrates the ondblclick event attribute with a button element − ...

Read More

HTML DOM Variable Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 274 Views

The HTML DOM Variable Object represents the element in the DOM tree. The element is used to define variables in mathematical expressions, programming code examples, or technical documentation. When accessed through JavaScript, it becomes a DOM object with properties and methods for manipulation. Syntax Following is the syntax to create a var object using JavaScript − document.createElement("VAR"); Following is the syntax for the HTML element − variable_name Creating a Variable Object The var object can be created dynamically using JavaScript's createElement() method. Once created, you can ...

Read More

HTML DOM KeyboardEvent altKey Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 153 Views

The HTML DOM KeyboardEvent altKey property returns a boolean value indicating whether the ALT key was pressed when a keyboard event was triggered. This property is particularly useful for detecting keyboard shortcuts and modifier key combinations in web applications. Syntax Following is the syntax for accessing the altKey property − event.altKey Return Value The altKey property returns a boolean value − true − If the ALT key was pressed when the event occurred false − If the ALT key was not pressed when the event occurred Example − Basic ...

Read More

HTML DOM Textarea name Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 178 Views

The HTML DOM Textarea name property returns or sets the value of the name attribute of a textarea element. The name attribute is used to identify the textarea when form data is submitted to the server. Syntax Following is the syntax for returning the name property − textareaObject.name Following is the syntax for setting the name property − textareaObject.name = "nameValue" Return Value The property returns a string representing the name attribute of the textarea element. If no name attribute is set, it returns an empty string. Getting ...

Read More

HTML DOM Textarea readOnly Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 279 Views

The HTML DOM Textarea readOnly property sets or returns whether a textarea element is read-only. When set to true, users cannot modify the textarea content, but they can still select and copy the text. This property is useful for displaying non-editable content in textarea format while preserving the element's visual appearance. Syntax Following is the syntax for getting the readOnly property − textareaObject.readOnly Following is the syntax for setting the readOnly property − textareaObject.readOnly = true | false Return Value The property returns a boolean value − ...

Read More

HTML DOM Textarea form Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 254 Views

The HTML DOM Textarea form property is a read-only property that returns a reference to the form element that contains the textarea. If the textarea is not enclosed within a form, this property returns null. Syntax Following is the syntax for the textarea form property − textareaObject.form Return Value The property returns a reference to the form element that contains the textarea, or null if the textarea is not inside a form. Example − Getting Form Reference Following example demonstrates how to get the form reference of a textarea element − ...

Read More

HTML DOM Textarea required Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 186 Views

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 More

HTML DOM Textarea maxLength Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 257 Views

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 More

HTML DOM Textarea select() Method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 211 Views

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 More

Increase or decrease units in HTML5 Canvas grid

Jennifer Nicholas
Jennifer Nicholas
Updated on 15-Mar-2026 418 Views

HTML5 canvas provides the scale(x, y) method to increase or decrease the units in the canvas grid. This allows you to draw scaled down or enlarged shapes and bitmaps by transforming the coordinate system. The method takes two parameters: x is the scale factor in the horizontal direction and y is the scale factor in the vertical direction. Both parameters must be positive numbers. Values greater than 1 enlarge, while values between 0 and 1 shrink the grid. Syntax context.scale(x, y); Parameters x: Horizontal scaling factor (positive number) y: Vertical scaling factor ...

Read More
Showing 21–30 of 36 articles
Advertisements