I'm trying to change the default behavior of a so that single-clicks on its options change the selected state of those options.
In other words, I want to remove unintuitive requirement of holding shift / ctrl to make multiple selections.
I'm trying with jQuery:
jQuery('select[multiple] option').each(function() {
var $this = jQuery(this);
if ($this.is(':selected')) {
$this.click(function(e) {
e.preventDefault();
$this.selected = 'false';
});
} else {
$this.click(function(e) {
e.preventDefault();
$this.selected = 'true';
});
}
});
but it's not working. Any ideas?