简体   繁体   中英

JS works in Safari but not IE9 - Can anyone help to make this work?

The script I am using can be found at this example

It works in Safari, but not IE9.

Any ideas on how to make it work?

event.target.value where's the event variable coming from? Maybe you forgot to specify the parameter?

Try:

document.getElementById('filter').onchange = function (event) {
    document.getElementById('field').value = event.target.value  
}
document.getElementById('filter').onchange = function (event) {
    document.getElementById('field').value = event.target.value  
}

Have you enabled JS in IE9?

If not, then do this in IE9: 1. Click on the "Tools" icon. (Tools icon is on the top right-hand corner of IE9, or Tools can also be found on the Menu bar as "Tools"). 2. Then click -> Internet Options" -> Security tab -> Custom Level button -> Scroll to the "Scripting" section near the bottom, and under "Active scripting" select Enable. 3. Click OK.

Now just close down IE9 completely, and restart a new instance of IE9 for javascript to get enabled and start working.

Regards, Reno Jones

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