Home Web Front-end JS Tutorial How to deal with checkbox/radio onchange not compatible with ie8 in javascript

How to deal with checkbox/radio onchange not compatible with ie8 in javascript

Jun 18, 2017 pm 01:06 PM
ie javascript js Radio about

This article mainly introduces the relevant information about javascript checkbox/radio onchange is not compatible with ie8. Friends in need can refer to it

javascript checkbox/radio onchange is not compatible with ie8 solution

Under ie8, checkbox onchange fails to trigger the custom function, how to solve this problem The problem is as follows:


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

Quote on the corresponding setting page:


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

The above is the detailed content of How to deal with checkbox/radio onchange not compatible with ie8 in javascript. For more information, please follow other related articles on the PHP Chinese website!

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Recommended: Excellent JS open source face detection and recognition project Recommended: Excellent JS open source face detection and recognition project Apr 03, 2024 am 11:55 AM

Recommended: Excellent JS open source face detection and recognition project

Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS Dec 17, 2023 pm 06:55 PM

Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems WebSocket and JavaScript: key technologies for implementing real-time monitoring systems Dec 17, 2023 pm 05:30 PM

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems

PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts Dec 18, 2023 pm 03:39 PM

PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts

What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser) What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser) Feb 10, 2024 am 10:30 AM

What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser)

JavaScript and WebSocket: Building an efficient real-time weather forecasting system JavaScript and WebSocket: Building an efficient real-time weather forecasting system Dec 17, 2023 pm 05:13 PM

JavaScript and WebSocket: Building an efficient real-time weather forecasting system

Simple JavaScript Tutorial: How to Get HTTP Status Code Simple JavaScript Tutorial: How to Get HTTP Status Code Jan 05, 2024 pm 06:08 PM

Simple JavaScript Tutorial: How to Get HTTP Status Code

How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page Mar 20, 2024 pm 09:21 PM

How to cancel the automatic jump to Edge when opening IE in Win10_Solution to the automatic jump of IE browser page

See all articles