Solution to click unresponsive and option unresponsive in ie8 mode
Click the option in the select and assign it to the input above, which is written directly with jQuery. The problem is that when it is opened in IE8, nothing happens when clicking the option.
The effect achieved is more common. Click the option in the select and assign it to the input above. It is written directly with jQuery:
$("#cardNoList option").click(function(){ $("#card").attr("value","").attr("value",this.value); })
There is a strange thing. Since the users basically use domestic dual-core browsers such as 360 Browser, with the addition of native Eclipse, the chrome kernel is used for parsing. When placed in the test environment, it becomes the IE8 standard for parsing.
Now here comes the question, learn to dig...well, no!
When opening it with IE8, nothing happens when clicking the option.
I tried adding alert:
$("#cardNoList option").click(function(){ alert("111"); $("#card").attr("value","").attr("value",this.value); alert("222"); })
click was not called at all.
At first, I thought it was a compatibility issue with jQuery's click event under IE8, but jQuery has encapsulated the compatibility and is widely used, so it shouldn't happen to me alone.
Later I thought that maybe the click was not added to the option in IE8. I changed it and added the click to the select. Now, IE8, Firefox, and Chrome can all assign values to the input smoothly.
$("#cardNoList").click(function(){ $("#card").attr("value","").attr("value",this.value); })
After searching on Baidu, it seems that "as we all know, in IE, the select option does not support onclick events" o(╯□╰)o
After being reminded, it was changed to:
$("#cardNoList").click(function(){ $("#card").val(this.value); }
The above is the entire content of this chapter. For more related tutorials, please visit jQuery Video Tutorial!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Vue is a popular front-end framework that helps developers build websites and applications more conveniently and quickly. Among them, v-on:click is the instruction in Vue used to monitor mouse click events. Let's introduce how to use v-on:click in Vue to monitor mouse click events. First of all, using v-on:click in Vue can define mouse click events in two ways: directly in the template and in the Vue instance. Below we will introduce these two methods respectively. direct

Solutions for vue ie8 incompatibility: 1. Use "babel-polyfill" to convert ES6 syntax to ES5; 2. Introduce "es6-promise"; 3. Prompt to upgrade the browser or pass "(function(w){if( !("WebSocket"in w&&2===w.WebSocket.CLOSING)){...}" Just jump to upgrade directly.

Vue is a popular front-end framework that is simple, efficient, and easy to maintain, and is loved by developers. In Vue, we often need to bind events to components or elements to achieve specific interactive effects, but sometimes we want the event to be triggered only by itself, without interference from other factors. So how to use v-on:click.self in Vue to trigger events only by yourself? This article will give you detailed answers. First, we need to understand the basic usage of the v-on instruction. The v-on directive is used to bind events, commonly used

Vue is a popular JavaScript framework for building modern web applications. In Vue, we usually use directives to operate DOM elements. Among them, the "click" event is one of the commonly used instructions. However, in Vue applications, we often encounter situations where the "click" event binding is invalid. This article explains how to solve this problem. The first step in checking whether an element exists is to confirm whether the element to which you want to bind a "click" event exists. If the element does not exist,

Vue is a popular JavaScript framework that provides developers with a variety of instructions and methods, allowing developers to deal with various problems encountered in web development more efficiently. Among them, the v-on directive can be used to bind handlers for various events, and v-on:click.capture means that the capture phase is used when processing click events. In JavaScript, the event propagation process is divided into three stages: capture stage, target stage and bubbling stage. At the capture stage

IE8 does not support HTML5. If you want IE8 to support HTML5, there are two ways: 1. Reference Google's html5.js file and put the code in the head tag interval; 2. By adding "while (i--){document. createElement(e[i])}" code implementation supports HTML5 elements.

The IE8 browser is loved by many users, but when we log in to some websites or perform some operations, we need to set the compatibility mode. Let this site carefully introduce to users how to set the ie8 compatibility mode. IE8 compatibility mode setting method: 1. After opening the IE8 browser, select [Tools] in the top menu bar, and then click [Compatibility View Settings] in the pop-up options. 2. Click [Add] in the window that opens to add the URL you want to be compatible with. 3. Re-open the set webpage, and you will see an icon like a torn piece of paper behind the address bar, indicating that the compatibility mode has been set successfully. You can also see the compatibility mode in the drop-down menu of the tool.

Vue is a very popular JavaScript framework in the front-end community. It can help us build efficient, flexible and easy-to-maintain web applications. Event bubbling is a very common problem in Vue, because in complex applications, multiple components may share the same DOM element. In this case, it is very convenient to use the v-on:click.stop directive to stop event bubbling. 1. What is event bubbling? Event bubbling refers to when an event on a DOM element is triggered
