AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 238 of 840

HTML DOM KeyboardEvent altKey Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 156 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

How to disable autocomplete of an HTML input field?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 489 Views

The autocomplete attribute in HTML controls whether the browser should automatically fill in form field values based on previously entered data. Setting autocomplete="off" disables this feature for enhanced privacy and security, particularly useful for sensitive fields like passwords or personal information. Syntax Following is the syntax for disabling autocomplete on an input field − To enable autocomplete explicitly − You can also disable autocomplete for an entire form − Disabling Autocomplete for Individual Fields The most common ...

Read More

How to turn off spell checking (grammar correction) for HTML form elements?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 221 Views

The spellcheck attribute in HTML controls whether the browser's spell checking feature is enabled or disabled for text input fields. By default, most browsers enable spell checking on text inputs and textareas, showing red underlines for misspelled words. Syntax Following is the syntax for the spellcheck attribute − The spellcheck attribute accepts three values − true − Enables spell checking for the element false − Disables spell checking for the element default − Uses the browser's default spell check behavior Disabling Spell Check To disable spell checking ...

Read More

How to create a file upload button with HTML?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 1K+ Views

To create a file upload button with HTML, we use the element with type="file". This creates a button that allows users to select and upload files from their device to a web server. Syntax Following is the basic syntax for creating a file upload button − The type="file" attribute transforms a regular input element into a file selection button. The name attribute identifies the file data when submitted to the server. Basic File Upload Button The simplest file upload implementation requires just the input element within a form. The browser ...

Read More

HTML DOM emphasized object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 181 Views

The HTML DOM emphasized object represents the HTML element in the Document Object Model. The element is used to emphasize text content, typically rendering it in italic style to indicate stress or importance. You can create and access emphasized objects using the createElement() and getElementById() methods respectively. Syntax Following is the syntax for creating an emphasized object − var emphasisElement = document.createElement("EM"); Following is the syntax for accessing an existing emphasized object − var emphasisElement = document.getElementById("elementId"); Properties The emphasized object inherits all standard HTML element properties ...

Read More

HTML DOM Legend form Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 173 Views

The HTML DOM Legend form property returns a reference to the form element that contains the element. This property is read-only and provides access to the parent form for DOM manipulation and validation purposes. Syntax Following is the syntax for accessing the form property − legendObject.form Return Value The form property returns a reference to the HTMLFormElement object that contains the legend, or null if the legend is not inside a form. Example Let us see an example demonstrating the Legend form property − ...

Read More

HTML DOM Legend Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 186 Views

The HTML DOM Legend Object represents the element in the Document Object Model. The element provides a caption or title for its parent element, helping to group related form controls together with a descriptive label. Syntax Following is the syntax for creating a element using JavaScript − var legendObject = document.createElement("LEGEND"); To access an existing element − var legendObject = document.getElementById("legendId"); Properties The Legend Object has the following property − Property Description form Returns a reference ...

Read More

jQuery Data vs Attr?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 2K+ Views

The data() method in jQuery is used to fetch values of custom data attributes from HTML elements and manages an internal cache system. The attr() method is used to get or set standard HTML attributes and directly manipulates the DOM. Understanding when to use each method is crucial for effective jQuery development. Syntax Following is the syntax for the jQuery data() method − $(selector).data(key); // Get data $(selector).data(key, value); // Set data Following is the syntax for the jQuery attr() method − ...

Read More

HTML DOM Form submit() method

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 1K+ Views

The HTML DOM Form submit() method is used to programmatically submit form data to the server address specified by the action attribute. This method acts like clicking a submit button, triggering form submission without user interaction. Syntax Following is the syntax for the Form submit() method − formObject.submit() Parameters The submit() method does not take any parameters. Return Value The method does not return any value. It simply submits the form data to the server. Example − Basic Form Submission Following example demonstrates how to use the submit() method ...

Read More

HTML DOM li Object

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 242 Views

The HTML DOM Li Object represents the (list item) element in the Document Object Model. This object provides properties and methods to manipulate list items dynamically using JavaScript. Accessing Li Objects You can access existing elements using various DOM methods − // Get li element by ID var liElement = document.getElementById("myListItem"); // Get all li elements var allLiElements = document.getElementsByTagName("li"); // Get li elements by class name var liByClass = document.getElementsByClassName("list-item"); Creating Li Objects Following is the syntax to create a new element − var liObject ...

Read More
Showing 2371–2380 of 8,392 articles
« Prev 1 236 237 238 239 240 840 Next »
Advertisements