Found 2202 Articles for HTML

How to specify that the form should not be validated when disabled in HTML?

Yaswanth Varma
Updated on 06-Sep-2022 07:39:45

189 Views

In HTML, forms for user input are created using the tag. The form tag uses a lot of different elements. When submitting a form, the novalidate attribute of the HTML tag is used to indicate that the form-data should not be validated. This attribute is a Boolean one. Following are the examples… Example In the following example we are using novalidate to make the form disabled after getting submitted. DOCTYPE html> Name: ... Read More

How to set the audio output of the video to mute in HTML?

Sreemaha
Updated on 03-Mar-2020 10:27:59

401 Views

Use the muted attribute to set the audio output of the video to mute. You can try to run the following code to implement muted attribute −Example                                        Your browser does not support the video element.          

Execute a script when an error occurs in HTML?

Yaswanth Varma
Updated on 15-Dec-2022 15:31:44

217 Views

In this article we are going to learn about how to execute a script when an error occurs in HTML. If an error happens while loading an external file, the onerror event is started (e.g. a document or an image). Let’s look into the following examples to understand more about how to execute a script when an error occurs in HTML. Using HTML Example In the following example we are using img to get displayed on our webpage using img src. ... Read More

How to specify that a user can enter more than one value in HTML?

Nishtha Thakur
Updated on 31-May-2020 00:19:32

147 Views

Use the multiple attribute in HTML to specify a user can enter more than one value.ExampleYou can try to run the following code to implement multiple attribute −           Upload multiple files                                  After uploading multiple files, click Submit.                    

How to specify the HTTP method to use when sending form-data in HTML?

Smita Kapse
Updated on 03-Mar-2020 10:20:50

266 Views

Use the method attribute to specify the HTTP method to use when sending form-data in HTML.ExampleYou can try the following code to implement method attribute −        HTML option Tag                                     HTML             Ruby                              

How to specify a minimum value in HTML?

Sravani S
Updated on 03-Mar-2020 10:21:41

155 Views

Use the min attribute to add the minimum value in HTML. You can try to run the following code to implement min attribute −Example                    Rank:                              

Execute a script when an element has been dragged to a valid drop target in HTML?

varma
Updated on 31-May-2020 00:20:20

123 Views

When an element has been dragged in HTML to a valid drop target, the ondragenter attribute fires.ExampleYou can try to run the following code to implement the ondragenter attribute −                    #boxA, #boxB {             float:left;padding:10px;margin:10px; -moz-user-select:none;          }          #boxA { background-color: #6633FF; width:75px; height:75px; }          #boxB { background-color: #FF6699; width:150px; height:150px; }                      function dragStart(ev) {             ev.dataTransfer.effectAllowed = 'move';             ev.dataTransfer.setData("Text", ev.target.getAttribute('id'));             ev.dataTransfer.setDragImage(ev.target,0,0);             return true;          }                              Drag and drop HTML5 demo          Try to drag the purple box around.                       Drag Me                    Dustbin          

Execute a script when the length of the media changes in HTML?

Nikitha N
Updated on 03-Mar-2020 10:18:52

243 Views

The ondurationchange attribute triggers when the length of the audio/ video changes in HTML.ExampleYou can try to run the following code to implement ondurationchange attribute −                                        Your browser does not support the video element.                      function display(vLength) {             alert("Video Length: " + vLength.duration + " seconds");          }          

Execute a script when the dragged element is being dropped in HTML?

Yaswanth Varma
Updated on 06-Sep-2022 07:34:07

314 Views

When a text selection or draggable element is dropped onto an authorised drop target, the ondrop event is triggered. It is simpler to move an object to a different area by engaging notion of drag and drop. Following are the examples… Example In the following example we are using executing a javascript when the draggable element is dropped in . DOCTYPE HTML> .droptarget { float: left; width: 100px; height: 35px; ... Read More

How do we add the maximum number of characters allowed in an element in HTML?

Yaswanth Varma
Updated on 06-Sep-2022 07:30:39

312 Views

In HTML, user input is obtained via the tag. The min and max properties, which indicate a maximum and minimum value for an input field, are used to limit the input field. Use the maxlength attribute to restrict the number of characters. Syntax Following are the examples… Example In the following example we are using the maxlength attribute with the input type to allow maximum number of elements. DOCTYPE html> style> body { text-align: center; } ... Read More

Advertisements