IE everlasting problem with selectors

2019-08-16 17:27发布

I think that i have some problems with jquery selectors in IE. Chrome and Firefox is ok, but not IE. Not only selector from example below not works. Every selectors not works in IE. I am using jquery 1.6.2 and jquery-ui.min 1.8
Example:
html:

<p id="clickme">clik me</p> 

jquery:

$(function(){
       $('#clickme').click(function(){alert('hello')})
})

2条回答
淡お忘
2楼-- · 2019-08-16 17:59

you should insert your code in document ready function of your js first.you should insert simicolon at the end of click function too.

for better help ,please insert your code completly here.

查看更多
3楼-- · 2019-08-16 18:26

Ok, I have had tons of problems with syntax on IE. Get in the habit of using semi colons. I looked at your JavaScript file and there was quite a few that seem to be non existent.

$('#clickme').click(function(){
    alert('hello');
});
查看更多
登录 后发表回答