Add a small javascript/HTML to a page
It looks like what's happening is your text format settings are stripping the JS out of the page. You can edit the formats by going to /admin/config/content/formats, or you may just need to select a different format for the node in question (under the body field when you edit the node).

If you need the JS available on several pages, have a look at: https://www.drupal.org/node/304255.