how to fire onchange event of a pull down menu

S

Steve

hi all
any body has any idea on how to fire onchange event of a pulldown menu
with script.
i need to trigger it so it when i select a certain option from
script,the event handler is executed
 
A

ASM

Steve a écrit :
hi all
any body has any idea on how to fire onchange event of a pulldown menu
with script.
i need to trigger it so it when i select a certain option from
script,the event handler is executed

<select onchange="alert(this.text);" ... >

<select
onchange="
var k = this.options.selectedIndex;
if(k==3) alert(this.text);
" ... >

<select
onchange="
var k = this.options.selectedIndex;
if(this.options[k].value=='ok') alert('winner');
" ... >

and so on
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,371
Latest member
TroyHursey

Latest Threads

Top