Jump to content

Is There A Selectedindexchanged Even In Javascript


aspquestions

Recommended Posts

Hello,I know that in other languages there is a selected_index changed event for drop down boxes which is called whenever a different item is selected in the drop down box. Is there a similar event in javascript so I could do something line <drop down box OnSelectedIndexchanged = ""> etc?

Link to comment
Share on other sites

<select name="blah" id="myselect" onchange="func()">or in the script itself (best practice):document.getElementById("myselect").onchange = func;Assignments like this generally are embedded in a window.onload handler, to ensure that the page element exists when you try to get a reference to it. (The DOM is constructed serially.)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...