InputEvent: 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.
InputEvent()
コンストラクターは、新しい InputEvent
オブジェクトを作成します。
構文
js
new InputEvent(type)
new InputEvent(type, options)
引数
type
-
イベントの名前の文字列です。 大文字小文字の区別があり、ブラウザーは
beforeinput
またはinput
を設定します。 options
省略可-
オブジェクトで、
UIEvent()
で定義されたプロパティに加え、以下のプロパティを持つことができます。inputType
省略可-
文字列で、テキストの挿入、削除、書式設定など、編集可能なコンテンツに対する変更の種類を指定します。
data
省略可-
文字列で、挿入する文字を保持します。 これは、変更がテキストを挿入しない場合(例えば、文字を削除する場合など)、空文字列になることがあります。
isComposing
省略可-
論理値で、そのイベントが変換セッションの一部であることを示します。つまり、
compositionstart
イベントの後で、compositionend
イベントの前にあることを意味します。既定では、false
です。
返値
新しい InputEvent
オブジェクトです。
仕様書
Specification |
---|
UI Events # dom-inputevent-inputevent |
ブラウザーの互換性
BCD tables only load in the browser
関連情報
InputEvent
: 構築するオブジェクトのインスタンスです。