Hi Michael,
You show us HTML code editor and JS code inside this editor it's incorrect.
If you need to use this JS Code you have two ways:
1 Add to your page JS "page show" event handler. And populate it with code you need. See details: http://prntscr.com/43fpi6/direct
2 Place code inside HTML component. But you need to wrap this code with tag <script. See example:
pre
<script
//This is JS code.
alert("Hello world");
</script
/pre
Regards.