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 on Trending Technologies
Technical articles with clear explanations and examples
HTML DOM Input FileUpload required Property
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 MoreExecute a script when the file is unavailable in HTML?
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 MoreHTML DOM Input FileUpload Object
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 MoreHow to use the formmethod attribute in HTML?
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 MoreExecute a script when the media has reached the end of HTML?
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 MoreHTML DOM Input Email required Property
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 MoreHow to use formtarget attribute in HTML?
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 MoreHTML5 Canvas drawings like lines are looking blurry
HTML5 Canvas drawings often appear blurry due to differences in device pixel ratios and improper coordinate positioning. This occurs because browsers scale canvas content differently across various devices and screen densities, leading to anti-aliasing effects that make lines and shapes appear fuzzy. The primary causes of blurry canvas drawings include − Device Pixel Ratio − Different devices have varying pixel densities, causing the browser to scale canvas content. Half-pixel positioning − Drawing on fractional pixel coordinates forces the browser to use anti-aliasing. Canvas size mismatch − When canvas display size differs from its actual resolution. ...
Read MoreHTML DOM Input Hidden Object
The HTML DOM Input Hidden Object represents an element with type="hidden" in an HTML document. Hidden input fields are invisible to users but store data that gets submitted with forms, making them useful for maintaining state information, tokens, or IDs. Syntax Following is the syntax to create an input hidden object − var hiddenInput = document.createElement("INPUT"); hiddenInput.setAttribute("type", "hidden"); You can also access an existing hidden input element − var hiddenInput = document.getElementById("hiddenFieldId"); Properties Following are the properties of HTML DOM Input Hidden Object − ...
Read MoreHow to create an ordered list with list items numbered with lowercase letters in HTML?
An ordered list is a numbered list of items that allows you to control the sequence numbering format. The tag creates ordered lists in HTML, while the tag defines individual list items. By default, ordered lists use numbers (1, 2, 3...), but you can customize the numbering format using the type attribute. To create an ordered list with lowercase letters (a, b, c...), use type="a" on the element. This is particularly useful for sub-lists, legal documents, or any content where alphabetical ordering is preferred over numerical. Syntax Following is the syntax to create an ...
Read More