Internet Explorer(IE)のバージョンを取得

Internet Explorer(IE)のバージョンを取得には、document.documentModeを使用します。

  • ※ Internet Explorerの独自機能です。

構文

var version = document.documentMode;

戻り値

Internet Explorerのバージョンを数値(5から11の整数)で返します。

サンプルコード

JavaScript

alert(document.documentMode);

JavaScript逆引きリファレンス一覧へ戻る