Found 2416 Articles for HTML

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

Prabhas
Updated on 03-Mar-2020 09:50:12

90 Views

Use the ondragover attribute in HTML to execute a script when the element is being dragged in HTML.ExampleYou can try to run the following code to implement the ondragover attribute −                    .drag {             float  : left;             width  : 100px;             height : 35px;             border : 2px dashed #876587;             margin : 15px;             padding: 10px;       ... Read More

Set the name of the form the element belongs to in HTML?

Jennifer Nicholas
Updated on 30-May-2020 23:45:14

92 Views

Use the form attribute in HTML to set the name of the one or more form the element belongs to in HTML.ExampleYou can try to run the following code to implement the form attribute −                    SubjectID:          Subject Name:          Total Students:             Click    

How to specify which form element a calculation is bound to with HTML?

Yaswanth Varma
Updated on 05-Sep-2022 12:55:33

100 Views

The HTML label tag enables us to click on the label, which will be treated as if we had clicked on the appropriate input type. The HTML can accept several input kinds, such as a radio button or checkbox. The for attribute provides the form element to which a label is bound. Syntax Label Content Following are the examples… Example In the following example if we click on the student the respected radio button will be selected, increasing the selection area.this is done with the help of for attribute. DOCTYPE html> Click ... Read More

Set where to send the form-data when a form is submitted in HTML?

Yaswanth Varma
Updated on 05-Sep-2022 12:54:15

149 Views

When a form is submitted, the input control's processing file's URL is specified using the HTML formaction property. The formaction attribute is invoked when the form has been submitted. After submitting the form, the form's data must be delivered to the server. Following are the examples… Example: Using method = “post” In the following example we are submitting the form using method=”post” DOCTYPE html> First name: ... Read More

Execute a script at the start of a drag operation in HTML?

Chandu yadav
Updated on 03-Mar-2020 09:44:59

51 Views

Use the ondragstart attribute in HTML to execute a script at the start of a drag operation in HTML.ExampleYou can try to run the following code to implement the ondragstart attribute −                    drag {          float: left;          width: 100px;          height: 35px;          border: 2px dashed #876587;          margin: 15px;          padding: 10px;          }                       ... Read More

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

Giri Raju
Updated on 03-Mar-2020 09:43:24

63 Views

Use the onended attribute in HTML to execute a script when the media has reached the end in HTML . You can add messages like “Thank you for watching”, “Stay tuned!”, etc.ExampleYou can try to run the following code to implement the onended attribute −                              Your browser does not support the video element.                      function display() {             alert ("Thank you for watching! Stay tuned!");          }          

Execute a script when the file is unavailable in HTML?

Arjun Thakur
Updated on 03-Mar-2020 09:51:09

130 Views

Use the onemptied attribute in HTML to execute a script when the file is unavailable in HTML or it is empty.ExampleYou can try to run the following code to implement the onemptied attribute −                              Your browser does not support the video element.                      function display()          {             alert ("Sorry! Empty playlist!");          }          

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

Yaswanth Varma
Updated on 05-Sep-2022 12:48:03

247 Views

Custom attributes are those that are specifically designed and are not included in the standard HTML5 attributes. They enable us to customise HTML tags by adding our own data. A custom attribute is any attribute whose name begins with data-. We can embed custom attributes on all HTML components using the data-* attributes. Syntax: HTML The syntax for the data-* attribute in HTML is relatively simple. Every element starting with data- is a data-* attribute. id = “sample” data-index = 1 data-row = 23 data-column = 44 ... Read More

Execute a script when an element is being dragged over a valid drop target in HTML?

Rishi Rathor
Updated on 03-Mar-2020 09:41:42

91 Views

When an element is being dragged and dropped in HTML, the ondragover attribute fires.ExampleYou can try to run the following code to implement the ondragover attribute −                    .drag {             float: left;             width: 100px;             height: 35px;             border: 2px dashed #876587;             margin: 15px;             padding: 10px;          }         ... Read More

How to specify the URL of the resource to be used by the object in HTML?

Sreemaha
Updated on 03-Mar-2020 09:40:41

93 Views

Use the data attribute in HTML to specify the URL of the resource to be used by the object in HTML.ExampleYou can try to run the following code to implement the data attribute −           Demonstration                

Advertisements