You do not need to open script tags, you just need to write the code that you need.
You better include it in the function defined in the section of the chapter:
<head> <script type="text/javascript"> function hello () { ... } </script> </head> <body> <input type="button" onclick="hello()" /> </body>
or, even better, load it from an external .js file:
<script type="text/javascript" src="scripts.js"></script>
source share