InputEvent

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

* Some parts of this feature may have varying levels of support.

InputEvent インターフェイスは、編集可能なコンテンツが変更されたことを通知するイベントを表します。

Event UIEvent InputEvent

コンストラクター

InputEvent()

InputEvent オブジェクトを作成します。

インスタンスプロパティ

このインターフェイスは、親である UIEventEvent のプロパティを継承しています。

InputEvent.data 読取専用

文字列で、挿入された文字を返します。変更により挿入されたテキストがない(例えば文字を削除した)場合は、空文字列になることがあります。

InputEvent.dataTransfer 読取専用

編集可能なコンテンツに追加されたリッチテキストまたはプレーンテキストデータ、あるいは削除されたプレーンテキストデータに関する情報を保持する DataTransfer オブジェクトを返します。

InputEvent.inputType 読取専用

テキストの挿入、削除、書式設定など、編集可能なコンテンツに対する変更の種類を返します。

InputEvent.isComposing 読取専用

論理値で、イベントが compositionstart の後かつ compositionend の前に発生したかを示す値を返します。

インスタンスメソッド

このインターフェイスは、親である UIEventEvent のメソッドを継承しています。

InputEvent.getTargetRanges()

入力イベントが取り消されない場合、DOM の変更に影響される静的範囲を配列で返します。

仕様書

Specification
Input Events Level 2
# interface-InputEvent
UI Events
# interface-inputevent

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
InputEvent
InputEvent() constructor
data
dataTransfer
getTargetRanges
inputType
insertFromPasteAsQuotation input type
Experimental
isComposing

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

関連情報