Found 2202 Articles for HTML

Execute a script when a file is ready to start playing in HTML?

Sreemaha
Updated on 24-Jun-2020 11:49:44

234 Views

You can use the oncanplay attribute for the following attributes − , , and .Example                                        Your browser does not support the video element.                      alert("I am ready to begin.");          

Execute a script when the element loses focus in HTML?

Govinda Sai
Updated on 03-Mar-2020 11:11:35

296 Views

Use the onblur attribute execute a script when the element loses focus in HTML. You can try to run the following code to implement onblur attribute −Example           Type text below!       Country:                function display() {             var str = document.getElementById("myid");             str.value = str.value.toUpperCase();          }          

Set the shape of the area in HTML

mkotla
Updated on 03-Mar-2020 11:10:57

160 Views

Use the shape attribute to set the shape of the area in HTML. You can try to run the following code to implement shape attribute −Example           HTML shape attribute                                              

How to specify that an option should be pre-selected when the page loads in HTML?

Jennifer Nicholas
Updated on 03-Mar-2020 11:10:09

149 Views

Use the selected attribute to specify that the option should be pre-selected when page loads in HTML. You can try to run the following code to implement selected attribute −Example           HTML selected attribute               Here's the list of subjects. Select any one:                             Computer Architecture             Java             Discrete Mathematics                    

How do we specify whether a header cell is a header for a column, row, or group of columns or rows in HTML?

Ankitha Reddy
Updated on 30-Jul-2019 22:30:22

102 Views

Use the scope attribute to implement whether a header cell is a header for a column, row, or group of columns or rows in HTML − Example Live Demo table, th, td { border: 1px solid black; } Cricketers Indian Cricketers Name 1 Sachin Tendulkar 2 Virat Kohli

How to specify that the styles only apply to this element's parent element and that element's child elements in HTML?

seetha
Updated on 03-Mar-2020 11:09:27

265 Views

Use the scoped attribute to specify that the styles only apply to the parent element and the element’s child elements −Example                    h2 {             color:yellow;          }                                           h2 {                color:grey;             }                    Grey Heading             Yellow Heading    

How to set the number of rows a table cell should span in HTML?

Vrundesha Joshi
Updated on 01-Jun-2020 08:50:05

3K+ Views

Use the rowspan attribute to set the number of rows a table cell should span. To merge cells in HTML, use the colspan and rowspan attribute. The rowspan attribute is for number of rows a cell should span, whereas the colspan attribute is for number of columns a cell should span.Example                    table, th, td {             border: 1px solid black;             width: 100px;             height: 50px;          }                     Heading                                                                                                                                                                

Enable an extra set of restrictions for the content in an