Found 2416 Articles for HTML

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

72 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

129 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

220 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

221 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

How to add the maximum value to HTML?

radhakrishna
Updated on 03-Mar-2020 10:15:45

88 Views

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

How to specify that the audio/video will start over again, every time it is finished in HTML?

V Jyothi
Updated on 24-Jun-2020 11:42:44

229 Views

Use the loop attribute to specify that the audio/ video will start over again. You can try to run the following code to implement loop attribute −Example                                        Your browser does not support the video element.          

How do we set the range that is considered to be of low value in HTML?

Yaswanth Varma
Updated on 06-Sep-2022 07:27:56

99 Views

The range in which a gauge's value is regarded as low is specified using the HTML | low property. The low attribute's value must be higher than the "min, " lower than the "max, " and equal to or less than the "high" attribute. Note − This can only be used with tag. Syntax Following are the examples… Example In the following example we are using the low attribute in the tag. DOCTYPE html> MSD score: 5 out of 10 ... Read More

Execute a script when the cue changes in a element in HTML?

Chandu yadav
Updated on 03-Mar-2020 10:02:12

80 Views

When the cue changes, the oncuechange attribute triggers in HTML. It works with the element.              Your browser does not support the video element.          

How to refer to a element that contains pre-defined options for an element in HTML?

Yaswanth Varma
Updated on 06-Sep-2022 07:26:00

332 Views

The HTML tag is used to add autocomplete functionality to form elements. It offers customers a set of predefined options from which to choose data. A "list" attribute containing "input" element should be used with the "" tag. The datalist id and the value of the "list" attribute are related. Following are the examples… Example In the following example we are using datalist to allow pre defined option for the user. If you press A, it will show a list of cricketers starting with A letter. DOCTYPE html> ... Read More

How to specify the language of the element's content in HTML?

Yaswanth Varma
Updated on 06-Sep-2022 07:21:31

334 Views

The language of an element's content can be identified using the HTML lang property. Language code, which is used to specify the language of the displayed information, is the only value for this element. Syntax Following are the examples… Example In the following example we are using lang property to specify the language of the element content. DOCTYPE html> English The Best E-Way Learning. french Le ... Read More

Advertisements