简体   繁体   中英

jQuery click event not firing in IE 7/8

This is the a tag which has a class with a background image:

            <a id="PLAY" class="Play_Unmarked">
            </a>

The class itself:

.Play_Unmarked{border:0px;display: block;background-image:url('images/tomgui3_07.png');background-repeat:no-repeat;width:206px;height:44px;text-decoration:none;}

Event handeling:

$(document).ready(function(){
$('.Play_Unmarked').click(function(d){
alert("Okay");
 });
});

Everything is fine in FF, IE9 and Chrome.. why is it not firing in ie7/8?

maybe elder IEs do not recognize <a> s without href s or name s

Works fine for me on IE6/7/8, give it a try from here please: http://jsfiddle.net/QbEDr/

don't forget to let us know if it work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM