In version 10, you should add the HTML Snippet and when you open the properties window you can select Javascript using the radio button.