Topic: JS function with xajax.$

This might be silly and do to a brain fart on my part....

How do I pass a parameter into the xajax.$ function
eval() maybe?

[code=Javacript]
function addOption(selectId, txt, val)
    {
        var objOption = new Option(txt,val);
       
        xajax.$(selectId).options.add(objOption);
    }
[/code]   


I am using xajax 0.5 4b.

Any help is appreciated.

Re: JS function with xajax.$

I *believe* it would be as follows (with slight coding style changes):

[code=Javacript]
    addOption = function(selectID, txt, val) {
        var objOption = new Option(txt,val);
        var objSelect = xajax.$(selectId);
        objSelect.appendChild(objOption);
    }
[/code]   

// Joe

xajax Developer
Connect to me on LinkedIn:
http://www.linkedin.com/in/calledtoconstruct