Adding JavaScript to a Web Page part 3
The <script> Tag
The <script> tag can take two attributes, language and type, which specify the script's type:<script language="javascript" type="text/javascript">
</script>
The language attribute is deprecated, and should not be used.
In the example below, we created an alert box inside the script tag, using the alert()function.
Result:
The type attribute: <scripttype="text/javascript"> is also no longer required, as JavaScript is the default HTML scripting language.
What attribute and what value is used along with the script tag?
<script
="text/
">
Comments
Post a Comment