Home > Web Front-end > JS Tutorial > body text

Summary: How to deal with the incompatibility of javascript checkbox/radio onchange with IE8

零下一度
Release: 2017-06-15 13:13:16
Original
1217 people have browsed it

This article mainly introduces the relevant information on how to deal with the incompatibility of javascript checkbox/radio onchange with ie8. Friends in need can refer to it

How to deal with the incompatibility of javascript checkbox/radio onchange with ie8

Under IE8, checkbox's onchange fails to trigger the custom function. How to solve this problem is as follows:

function forIe(){ 
  if($.browser.msie){ //判断浏览器是否为ie 
    $("input[type='checkbox']").click(function(){ 
      this.blur(); //先失去焦点,执行你的自定义的操作 
      this.focus();//再获取焦点,是鼠标还在那个地方,好进行下一步的操作 
    }) 
  } 
}
Copy after login


Just quote on the corresponding setting page:


$(function(){ 
    forIe(); 
  })
Copy after login


The above is the detailed content of Summary: How to deal with the incompatibility of javascript checkbox/radio onchange with IE8. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template