Dear ALL, I am trying to do soemthing quite straightforward but can't get my head around the syntax.
I have a dropdown list. The OPTIONs have two types of classes. If an OPTION with class 'less_than_3' is chosen we see an alert. And if an OPTION with class 'greater'- we see a different alert.
Heres my attempt: (please note I originally had a working version by attaching the click handler directly to the OPTION element. but this only worked in Firefox so I changed my approach.
$('#time_at_address').change(function() {
if ( $(this).children('.less_than_3:selected') ) {
alert('less than 3!');
}
if ( $(this).children('.greater_than_3:selected') ) {
alert('greater than 3!');
}
});