You will see many sites with the following type of code:
Script elements:
<script type="text/javascript">
//javascript here
</script>
Link elements:
<link rel="stylesheet" href="url.css" type="text/css" media="all" />
Style elements:
<style type="text/css">
/* CSS */
</style>
My question is this:
Are the type attributes needed in the popular browsers today?
(Popular meaning IE 8+, Firefox, Webkit, Opera and Chrome)
What happens if you do not include them?
Note: The answer needs to cover both HTML5 and XHTML doctypes if there is a difference in behavior between the two.
In short, they are not required since HTML5, but are required by W3C standards in HTML4/XHTML.
In HTML5
typeofscripttag:in HTML4 and XHTML it’s required by W3C standards.
For
styleandlinktype: