JavaScript onSelect for dropdown?

I’m wondering if there is a way to use JavaScript on <option> values in a drop down within a form.

I’m trying to get a hidden <div> to show on selection of the “two”

<select name="number" id="number" onchange="Effect.appear('1',)">
		<option>One (default)</option>
		<option onselect="Effect.appear('1',)">Two</option>

this doesn’t seem to work. Any thoughts out there? I’d hate to recreate the dropdown as a <ul> but unfortunately that’s the way I’m starting to think.

Onselect: occurs when text is selected in a text or textarea field. Not option.

You would need to add a condition checking onchange and check for selectedIndex

Thanks for the reply. I tried:

	&lt;option&gt;One (default)&lt;/option&gt;
	&lt;option onchange="Effect.appear('1',)"&gt;Two&lt;/option&gt;

but it doesn’t seem to work.

you have a comma after ‘1’ in:

removed comma. still not any better :frowning:

The onchange goes on the select tag not the option tag since the option never changes.

You then need code in the onchange to test which option is selected.