To
insert a JavaScript into an HTML page, we use the <script> tag. Inside
the <script> tag we use the type attribute to define the scripting
language.
So,
<script type="text/javascript"> and </script> tell
where the Java-Script starts and ends:
<html>
<body>
<script type="text/javascript">
document.write("Hello
World!");</script>
</body>
Note: If we had not typed the
<script> tag, the browser would have treated the document.write(“Hello
World!”) command as pure text and would just write the entire line on the page.
0 comments:
Post a Comment