Ie8 mode click unresponsive click option unresponsive solution
- 2020-03-30 04:05:03
- OfStack
Think of the elementary school time countless a small matter, ah, the running under the sunset, is my passing youth.
To get back to the point, here is the image above:
< Select id = "cardNoList" size = "4" > < / select>
One of the common effects is to click the option in the select and assign it to the above input, which is directly written in jQuery:
$("#cardNoList option").click(function(){
$("#card").attr("value","").attr("value",this.value);
})
There's a strange thing,
As a result of face the user basically is to use 360 browser this kind of domestic dual core browser, added
< Meta HTTP - equiv = "X - UA - Compatible" content = "IE = Edge, chrome = 1" / >
Native Eclipse runs are parsed using the chrome kernel, which becomes the ie8 standard parsed in the test environment.
Now the question is, learn to dig... Well, no!
When opened with IE8, clicking option did not respond.
Add alert and try:
$("#cardNoList option").click(function(){
alert("111");
$("#card").attr("value","").attr("value",this.value);
alert("222");
})
The click is not called at all.
At first, I thought it was the compatibility problem of jQuery's click event in ie8, but jQuery encapsulates and solves the compatibility problem. The application is so wide that I would not normally encounter it.