The defer attribute tells those browsers that recognise it that there is no reason to delay rendering the HTML while the script loads but also tell it that the script need not be run straight away but can instead wait for the HTML to finish rendering before it gets run. A script using this attribute could be included anywhere in the HTML and would be able to reference all of the HTML from within the script without needing to test if the HTML has finished loading because the defer attribute guarantees that the HTML has finished loading before the script runs. This attribute is supported by more browsers than the async attribute is because it was implemented earlier. It is supported by IE5.5+, Firefox 3.5+, Google Chrome 8+, Safari 5+ but is still not supported by Opera even in version 12.5. Since we cannot guarantee that the browser displaying the page supports the attribute we cannot guarantee that the HTML will have finished rendering before the script runs unless the script tag is placed at the bottom of the page (where we would place it so as to allow the page to appear to load faster anyway). If the script tags are placed at the bottom of the HTML then the defer attribute would make little difference to the actual loading and running of the script since there is no HTML after the script tag for the script to wait to be rendered.
or in XHTML 1.0/5 using:
This article written by Stephen Chapman, Felgall Pty Ltd.