I\'ve got a page with a variable number of elements (which explains why I\'m using event delegation here). When the user changes the selected opt
I'm simply building upon the example set by "Crescent Flesh" for a cross-platform solution that will survive even if loading this SELECT inside #container via an AJAX call.
$('#container').bind($.browser.msie ? 'click' : 'change', function(event) {
if ((event.type == 'click') || (event.type == 'change')) {
if (event.target.toString().indexOf('Select') != -1) {
var sWhich = $('#container SELECT').val();
handleSelectionChange(sWhich);
}
}
});
Now you simply build the handleSelectionChange() function, renaming it whatever you want.