Move js to a new file called script.js then in html: <script type="text/javascript" src="script.js"></script>