JQuery returns wrong value for IE Compatibility

Posted by o-logn on Stack Overflow See other posts from Stack Overflow or by o-logn
Published on 2010-04-12T17:20:07Z Indexed on 2010/04/12 17:23 UTC
Read the original article Hit count: 306

Hey ,

I'm using JQuery and there seems to be a problem when I run IE in compatibility mode (and generally any IE less than version 8). I'm trying to use attr("value") for a button control. In IE8, and other browsers, this works fine and the result of this code:

alert($(this).attr("value"));

is simply the value of set in the button attribute (e.g. Home, Settings, Help etc..)

However, when this is run in IE compatibility view, I get the entire HTML as the output value:

<SPAN class=ui-button-text>Home</SPAN>

This causes my checks to fail. Is there a way to return just the Home section across all browsers? Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about internet-explorer