Jump to content

Calling a javascript function with a select option?


son.of.the.morning

Recommended Posts

The usual event gang, onclick etc. The best to use is onchange though as it will not do anything if you select the same option.

<select onchange="">

 

Unless your asking about executing the js from within the option tag itself (your question is a bit ambiguous). Then I believe no events are supported by the option tag. However, if you are trying to find the value of the option that the user has selected, you just have to ask what the value of the select tag is. It will equal the selected option tag.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.