ウィンドウを背面に表示

ウィンドウを背面に表示するには、window.blurメソッドを使います。

構文

windowName.blur();

サンプルコード

次のサンプルコードでは、現在のウィンドウを背面に表示します。

JavaScript

window.blur();

次のサンプルコードでは、サブウィンドウを開き、そのサブウィンドウを背面に表示します。

JavaScript

var subWindow = window.open('https://example.co.jp/', '_blank');

subWindow.blur();

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