Ok so i have a jQuery .change
$('#application').change(function(){
var selected = $(this).val().trim();
alert(selected);
if(selected == 'something') {
$('#profile-info').show();
}
....
....
my html
<select name="application" id="application">
<option value="--select something--">--select something--</option>
<option value="first">first</option>
<option value="second">second</option>
<option value="third">third</option></select>
The alert fires on all browsers but IE…..ie8 and 7 dont work at all
any ideas what i might be missing
This is because the method “trim” is not supported in anything below IE9.
If you get rid of the trim, it works just fine:
Check the error console in the IE developer tools (press F12) to see the javascript error you are receiving.
Check out my example working in IE8: http://jsfiddle.net/Ku8HL/1/.
EDIT: jQuery actually has a trim method, so you can use $.trim to accomplish the same thing. IE8 and below do not have a trim method on the String object. I’ve updated the code above and the jsfiddle to include the jQuery trim method.