I just tried this in a post of the latest WP install:
<script>function update(){alert('this is the update box');}</script>
<select name="cities" id="cities" onchange="javascript:update();">
<option>1</option>
<option>2</option>
</select>
This seemed to work fine.
You will probably encounter that if you have any lengthily code for javascript that maybe then you should put that code into a file and point to it in the post/page. Like so:
<script src="path_to_javascript_file"></script>
But one other note. I generally do not want this .... If a site or a page needs to have some javascript added then maybe you need to ask yourself why.
IMHO for javascript and anything that can be lengthily in nature I would prefer to write a plugin.