Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The doctype isn’t the only thing that has been simplified in HTML5.
If you want to specify the character encoding of a markup document, the best way is to ensure that your server sends the correct Content-Type header. If you want to be doubly certain, you can also specify the character set using a <meta> tag. Here’s the meta declaration for a document written in HTML 4.01:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Here’s the much more memorable way of doing the same thing in HTML5:
<meta charset="UTF-8">
As with the doctype, this simplified character encoding contains the minimum number of characters needed to be interpreted by browsers.
The <script> tag is another place that can afford to shed some fat. It’s common practice to add a type attribute with a value of “text/javascript” to script elements: