Execute Script After Page Parsing in HTML

Rishi Rathor
Updated on 03-Mar-2020 05:29:14

403 Views

Use the defer attribute to execute the script when the page has finished parsing in HTML.Firstly, add a js file.Let us give it a name, new.js,function sayHello() {    alert("Hello World") }ExampleLet’s add the HTML code now and execute the above script −                         This is demo text.    

Identify Track to Enable Based on User Preferences in HTML

Sravani S
Updated on 03-Mar-2020 05:28:15

88 Views

Use the default attribute to identify that the track is to be enabled, if you’re providing with two subtitle tracks for the video.ExampleYou can try the following code to implement the default attribute for tracks −                                                            Your browser does not support the video element.          

Specify Number of Columns a Table Cell Should Span in HTML

radhakrishna
Updated on 03-Mar-2020 05:27:24

850 Views

Use the colspan attribute to set the number of columns a table cell should span. You can try to run the following code to implement colspan attribute −                    table, th, td {             border: 1px solid black;          }                     Total Marks                Subject          Marks                       Maths             300                                 Java             450                                 Total Marks: 750                    

Display Visible Width of a Text Area in HTML

Arjun Thakur
Updated on 03-Mar-2020 05:26:22

193 Views

Use the cols attribute in HTML to display the visible width of a textarea. You can try to run the following code to implement cols attribute −Example                    This is a demo paragraph. This is a demo paragraph.          This is a demo paragraph. This is a demo paragraph.          

Include Character Encoding in HTML

Nishtha Thakur
Updated on 03-Mar-2020 05:23:51

187 Views

Character encoding is a method of converting bytes into characters. To validate or display an HTML document properly, a program must choose a proper character encoding.Use the element, to set the charset attribute and specify the character encoding for the HTML document −                         Click following link       Welcome to Qries    

Display Thickness of Border of an Element in HTML

Chandu yadav
Updated on 02-Mar-2020 12:46:08

168 Views

Use the border attribute in HTML to display the thickness of the border.Note − This attribute is not supported in HTML5.ExampleYou can try to run the following code to learn how to implement border attribute in HTML −           Cricketers                Name                       Sachin Tendulkar                                 Virat Kohli                     Use CSS instead, since the border attribute deprecated in HTML5.                    table, th, td {             border: 1px solid black;          }                     Cricketers                Indian Cricketers          Name                       Sachin Tendulkar                                 Virat Kohli                    

Display Background Color of an Element in HTML

Abhinaya
Updated on 02-Mar-2020 12:44:56

921 Views

Use the bgcolor attribute in HTML to display the background color of an element. It is used to control the background of an HTML element, specifically page body and table backgrounds.Note − This attribute is not supported in HTML5.ExampleYou can try to run the following code to learn how to implement bgcolor attribute in HTML −           HTML Background Colors                                                          This background is yellow                                                                              This background is sky blue                                                                              This background is green                                

Start Audio/Video Playback When Ready in HTML

Ankith Reddy
Updated on 02-Mar-2020 12:44:10

338 Views

Use the autoplay attribute to set that the audio or video will start playing automatically as the page loads.ExampleYou can try to run the following code to implement autoplay attribute in HTML −                                        Your browser does not support the video element.          

Automatically Focus an Element on Page Load in HTML

mkotla
Updated on 02-Mar-2020 12:43:31

268 Views

Use the autofocus attribute to specify that the element should get focus automatically on page load in HTML −ExampleYou can try to run the following code to learn how to implement autofocus attribute in HTML −           Click on the below button to generate an alert box.       Result    

Execute Script Asynchronously in HTML

Abhinanda Shri
Updated on 02-Mar-2020 12:41:44

138 Views

Use the async attribute to set the script to execute asynchronously as and when it is available. It only uses the external script.Firstly, add a js file. Let us give it a name, new.js,function sayHello() {    alert("Hello World") }Let’s add the HTML code now and execute the above script −                         This is demo text.    

Advertisements