Home → References → HTML Tags →
HTML Tag: script
Used to define a scripting language, such as JavaScript.
HTML Dog is hosted by Titan Internet
Required Attributes
typeis used to specify what type of scripting language is used. This takes the form of a MIME type such astext/javascript.
Optional Attributes
srccan be used to specify an external source of a script file.charsetcan be used to specify the character set of the element.defercan be used to specify that the script does not generate any document content so that the browser doesn't have to worry about it while the page loads. It must be used in the formatdefer="defer".
Example
<script type="text/javascript" src="somescript.js"></script>
<script type="text/javascript">
function koala() {
alert('KOALA! KOALA!');
}
</script>

