Learn html - html tutorial - defer attribute in html- html examples - html programs
- The defer attribute is a Boolean attribute.
- The defer attribute specifies that the script is executed after the page has finished parsing.
Syntax for defer attribute in HTML:
Sample Coding for defer Attribute in HTML:
Sample Coding for defer attribute script.js:
Code Explanation for defer Attribute in HTML:
- defer attribute is used to specify the script file must be load after parsing the page content
- The alert box will be display the value of the element which has id as “p1”.
Output for defer Attribute in HTML:
- The content is written inside the <p> tag as it is shown in the output.
- alert dialog box shows “Wikitechy”. If we did not declare the defer attribute the value cannot be displayed in the alert box, because the script file declared before the content.
Browser Support for defer Attribute in HTML:
Tips and Notes
- The defer attribute is only used in external <script> element.
Related Searches to defer Attribute in html
script async defer
html script defer
script defer async
script tag defer
script defer defer
html tutorialshtml editor html code html form html tutorial html color html color codes html table html img html5 html code for website html and css html programs html website free html editor html5 tutorial wysiwyg html editor html tutorial pdf html converter php tutorial html example html tutorial css tutorial html css html tags html basics code html html online html mailto html lang html tags list