Skip to main content

Bug Tracker

Side navigation

Ticket #5700: ie8bug.html

File ie8bug.html, 1.2 KB (added by matiasnu, December 22, 2009 11:54AM UTC)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
		<title>jQuery 1.3.2 Selector bug in IE8</title>
        <div class="elem">Element 1</div>
        <div class="elem">Element 2</div>
        <div class="elem">Element 3</div>
        <p>This will work in Firefox 3.5 and Chrome, but not in IE8, which will select all elements</p>	   
	    <button class="b1">Using .elem:not(:first)</button>
	    <p>This will work in all browsers, since we're using TAG.class</p>	   
	    <button class="b2">Using div.elem:not(:first)</button>
	    <script src="" type="text/javascript"></script>
	    <script type="text/javascript">
	        $().ready(function() {
                $("button.b1").click(function() {
                    $(".elem:not(:first)").css("background", "red");      
                $("button.b2").click(function() {
                    $("div.elem:not(:first)").css("background", "green");      

Download in other formats:

Original Format