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.

Edit
Report