It is standard practice to put client-side scripts in the Head section of your document, but the Page view in the HTML editor does not handle scripts in the Head section.
You can put client-side scripts in the Body section, but:
Scripts are not allowed within a TEXTAREA or SELECT tag
There are restrictions for server scripts that build client scripts