Skip to content Skip to sidebar Skip to footer

Update Script Var's With Value From Drop Down?

I have a script, which basically looks like this (the part I need help with): If I had a drop

Solution 1:

You can bind a change event handler to the select element:

document.getElementById("yourSelect").onchange = function() {
    languageFrom = this.value;
}

Note that this assumes an id of yourSelect on the select element, and also assumes that languageFrom is in the scope of the event handler function (probably global).

Solution 2:

selectNode.addEventListener("change", function(evt) {
        languageFrom=languageTo;
        languageTo = evt.target.value;
    },false);

Post a Comment for "Update Script Var's With Value From Drop Down?"