defines a JavaScript


<script type="text/javascript">

Browser
Internet Explorer Firefox Opera

This SCRIPT element defines a JavaScript.


<script type="text/javascript">

JavaScript Codes

</script>


Attribute Value Explanation
type=" " text/javascript MIME type

Example

<html>
<head>
<title>TAG index</title>

<script type="text/javascript">

function demo(){ 

	window.alert('Hello'); 

}

</script>

</head>
<body>

<script type="text/javascript">

document.write('<p><input type="button" value="Alert" onclick="demo()"></p>');

</script>


<noscript>
<p>JavaScript cannot be used.</p>
</noscript>

</body>
</html>
Output