How to pass parameters to an onchange function for an element dynamically created with the DOM?

tr5
tr5 used Ask the Experts™
on
Hi
I create a <select> element like this:
var selectList=document.createElement("select");
selectList.id='exh_list';
selectList.onchange=function(){processExh();}
etc

The problem is that I need to pass some parameters to processExh() when the onChange fires. How do I so this?

Thanks
tr5
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
What parameters?  What are the parameters related to?

Genericly, you just do it like these examples:

selectList.onchange=function(){processExh(p1,p2,p3,etc.);}

selectList.onchange=function(){processExh('ahardcodedstring','otherparm');}

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial