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 AmitDiwan
Page 268 of 840
HTML DOM Input Submit formEnctype property
The HTML DOM Input Submit formEnctype property is used to set or return the formenctype attribute value of a submit button. This property specifies how form data should be encoded when submitted to the server, and it overrides the enctype attribute of the parent element. The formenctype property only works when the form method is POST. It was introduced in HTML5 for input elements with type="submit". Syntax Following is the syntax for setting the formEnctype property − submitObject.formEnctype = encoding Following is the syntax for getting the formEnctype property − ...
Read MoreHow to adjust the width and height of an iframe to fit with content in it HTML?
We can adjust the width and height of an iframe to fit its content using CSS properties, HTML attributes, or JavaScript. An iframe (inline frame) allows you to embed another HTML document within the current page, and controlling its dimensions is essential for proper layout and user experience. The main challenge with iframe sizing is that the browser cannot automatically determine the content dimensions, especially for cross-origin content due to security restrictions. However, there are several effective approaches to handle iframe sizing. Syntax Following is the basic syntax for an iframe element − ...
Read MoreHTML DOM Input Submit formMethod property
The HTML DOM Input Submit formMethod property sets or returns the value of the formmethod attribute of a submit button. This property specifies which HTTP method should be used when sending form data to the server and overrides the method attribute of the parent element. Syntax Following is the syntax for setting the formMethod property − submitObject.formMethod = "get|post" Following is the syntax for returning the formMethod property − var method = submitObject.formMethod Property Values The formMethod property accepts the following values − get − The ...
Read MoreHTML DOM InputEvent inputType Property
The HTML DOM InputEvent inputType property returns a string indicating the type of input action that triggered an input event. This property helps identify whether the user is typing text, deleting content, pasting, or performing other input operations on form elements. Syntax Following is the syntax for accessing the inputType property − event.inputType Return Value The inputType property returns a string representing the type of input. Common values include − "insertText" − When user types regular text "deleteContentBackward" − When user presses Backspace "deleteContentForward" − When user presses Delete "insertParagraph" − ...
Read MoreHTML DOM Geolocation position property
The HTML DOM Geolocation position property provides access to a user's device location and position data on Earth. The user must explicitly approve location sharing before this property can function, ensuring privacy protection. This property is commonly used for location-based services and tracking applications. Syntax Following is the syntax for accessing the position property − position.coords position.timestamp The position object is typically obtained through the navigator.geolocation.getCurrentPosition() method callback function. Properties The position object contains the following read-only properties − Property Description position.coords Returns a ...
Read MoreHTML DOM Input Submit formNoValidate property
The HTML DOM Input Submit formNoValidate property sets or returns whether form data should be validated when submitted. This property overrides the form's novalidate attribute and is specifically used with submit buttons to control validation behavior on a per-button basis. Syntax Following is the syntax for setting the formNoValidate property − submitObject.formNoValidate = true|false Following is the syntax for getting the formNoValidate property − var value = submitObject.formNoValidate Parameters The formNoValidate property accepts the following values − true − The form data should not be validated when ...
Read MoreHTML DOM Textarea form Property
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 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 MoreHow to allow cross-origin use of images and canvas in HTML?
To allow cross-origin use of images and canvas in HTML, you need to handle CORS (Cross-Origin Resource Sharing) restrictions that browsers enforce for security. When loading images from external domains onto a canvas, the browser marks the canvas as "tainted" unless proper CORS headers are present. Understanding Cross-Origin Issues When you draw an image from a different domain onto a canvas, the browser applies same-origin policy restrictions. This prevents you from reading pixel data or exporting the canvas content using methods like toDataURL() or getImageData(). Cross-Origin Canvas Flow External ...
Read MoreHTML DOM Input Submit formTarget property
The HTML DOM Input Submit formTarget property sets or returns the formtarget attribute value of a submit button. This property specifies where to display the server response after form submission, effectively overriding the target attribute of the parent form element. Syntax Following is the syntax for setting the formTarget property − submitObject.formTarget = "_blank|_self|_parent|_top|framename" Following is the syntax for getting the formTarget property − var target = submitObject.formTarget Parameters The formTarget property accepts the following values − _blank − Opens the response in a new window or ...
Read More