I'm going to recommend not rewriting this code for the umpteenth time. I would recommend you use the Conditionizr library ( ) which is capable of testing for specific IE versions as well as other browsers, operating systems, and even the presence or absence of Retina displays.