7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【jQuery】IEでフォーカスが外れるまでをイベントにしてしまう時の対応法

Posted at

IEでchangeを使用したときに、要素からフォーカスが外れるまで、処理が完了しない時があります。
これは、IEがフォーカスが外れるまでをイベントとしてしまっているかららしく、とても困りました。
※IE8でこの現象が起きました。

以下のように、blurを使うことで解決することが出来ます。

jquery.js
$(function(){
	$(.select).change(function(){
		$(this).toggleClass("checked");
		$(this).blur();
	});
});
7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?