Articles on Trending Technologies

Technical articles with clear explanations and examples

Why formaction attribute is not working outside of tag?

Sharon Christine
Sharon Christine
Updated on 16-Mar-2026 923 Views

The formaction attribute can work outside the tag by using the form attribute to associate external buttons with a specific form. The formaction attribute specifies an alternate action URL for form submission, allowing multiple submit buttons to send data to different server endpoints. How Formaction Works When you submit a form, the browser follows this priority order − First − Check for formaction attribute on the submit button Second − Use the action attribute on the element Default − Submit to the current page if neither is specified Syntax Following is ...

Read More

How to use formenctype attribute in HTML?

karthikeya Boyini
karthikeya Boyini
Updated on 16-Mar-2026 345 Views

The formenctype attribute in HTML specifies how form data should be encoded when submitting to the server. This attribute was introduced in HTML5 and is only used with input elements of type submit and image. It overrides the form's default enctype attribute for that specific submit button. Syntax Following is the syntax for the formenctype attribute − The encoding-type specifies how the form data should be encoded before sending it to the server. Formenctype Attribute Values The formenctype attribute accepts three possible values − Value Description ...

Read More

How to store custom data private to the page or application in HTML?

Yaswanth Varma
Yaswanth Varma
Updated on 16-Mar-2026 788 Views

HTML data-* attributes allow you to store custom data directly within HTML elements. These attributes provide a standardized way to embed application-specific information that can be accessed via JavaScript and CSS without interfering with HTML semantics. The data-* attributes are part of the HTML5 specification and offer a clean alternative to using non-standard attributes or hidden form fields for storing custom data. Any attribute name beginning with data- followed by at least one character is considered a valid data attribute. Syntax Following is the syntax for data-* attributes in HTML − Content The ...

Read More

HTML DOM Input FileUpload required Property

karthikeya Boyini
karthikeya Boyini
Updated on 16-Mar-2026 369 Views

The HTML DOM Input FileUpload required property sets or returns whether a file upload field must be filled out before submitting a form. This property reflects the HTML required attribute and is a boolean value that determines form validation behavior. Syntax Following is the syntax for returning the required property − object.required Following is the syntax for setting the required property − object.required = true|false Parameters The required property accepts boolean values − true − The file upload field is required and must be filled before form ...

Read More

Execute a script when the file is unavailable in HTML?

Arjun Thakur
Arjun Thakur
Updated on 16-Mar-2026 320 Views

The onemptied attribute in HTML is an event handler that executes JavaScript code when a media element (audio or video) becomes unavailable or empty. This event typically occurs when the media file cannot be loaded, the playlist becomes empty, or the media source is removed during playback. Syntax Following is the syntax for the onemptied attribute − The script parameter contains JavaScript code or a function call that executes when the emptied event is triggered. When the Emptied Event Occurs The emptied event is fired in the following scenarios − ...

Read More

HTML DOM Input FileUpload Object

karthikeya Boyini
karthikeya Boyini
Updated on 16-Mar-2026 580 Views

The HTML DOM Input FileUpload Object represents an element with type="file" in an HTML document. This object provides properties and methods to interact with file upload elements programmatically, allowing developers to create, modify, and access file input controls dynamically. Creating a FileUpload Object You can create a FileUpload object dynamically using JavaScript's createElement() method − Syntax var fileUploadBtn = document.createElement("INPUT"); fileUploadBtn.setAttribute("type", "file"); Alternatively, you can access an existing file input element using − var fileUploadBtn = document.getElementById("fileId"); // or var fileUploadBtn = document.getElementsByTagName("input")[0]; Properties The HTML DOM ...

Read More

How to use the formmethod attribute in HTML?

Nancy Den
Nancy Den
Updated on 16-Mar-2026 336 Views

The formmethod attribute in HTML is used to override the default HTTP method specified in a form's method attribute. It is used specifically with elements of type submit and image, allowing different submit buttons within the same form to use different HTTP methods (GET or POST). Syntax Following is the syntax for the formmethod attribute − Where method can be either "get" or "post". Parameters The formmethod attribute accepts the following values − get − Appends form data to the URL as query parameters. Data is visible in ...

Read More

Execute a script when the media has reached the end of HTML?

Giri Raju
Giri Raju
Updated on 16-Mar-2026 252 Views

The onended attribute in HTML executes a script when media playback reaches its natural end. This event is triggered for and elements when the media finishes playing, allowing you to display messages, suggest related content, or perform other actions. Syntax Following is the syntax for the onended attribute − ... ... The function() represents a JavaScript function that will execute when the media reaches its end. Video Element with onended Example Following example demonstrates the onended attribute with a video element − ...

Read More

HTML DOM Input Email required Property

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 242 Views

The HTML DOM Input Email required property determines whether an email input field must be filled out before submitting a form. This property corresponds to the required HTML attribute and provides a way to access and modify the required state of email input elements using JavaScript. Syntax Following is the syntax for getting the required property value − inputEmailObject.required Following is the syntax for setting the required property − inputEmailObject.required = booleanValue Parameters The booleanValue parameter can be one of the following values − Value ...

Read More

How to use formtarget attribute in HTML?

Krantik Chavan
Krantik Chavan
Updated on 16-Mar-2026 392 Views

The formtarget attribute in HTML specifies where to display the response after submitting a form. This attribute overrides the target attribute of the element and is used only with and elements. Syntax Following is the syntax for the formtarget attribute − Where value can be _blank, _self, _parent, _top, or a custom frame name. Attribute Values The formtarget attribute accepts the following values − Value Description _blank Response gets displayed in a new window or tab _self The ...

Read More
Showing 13541–13550 of 61,299 articles
Advertisements