From b2713396a5c3fee9b96a97e62a4696cd1fb32504 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Mon, 19 Jul 2021 01:07:10 +0900 Subject: Web/API/Document 以下の conflicting 版を削除 (#1486) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - conflicting 版を削除 - 該当記事を 2021/07/11 時点の英語版に同期 --- files/ja/web/api/document/createevent/index.html | 95 ++++++++++-------------- 1 file changed, 40 insertions(+), 55 deletions(-) (limited to 'files/ja/web/api/document/createevent') diff --git a/files/ja/web/api/document/createevent/index.html b/files/ja/web/api/document/createevent/index.html index 2ce401a236..aac681026f 100644 --- a/files/ja/web/api/document/createevent/index.html +++ b/files/ja/web/api/document/createevent/index.html @@ -4,34 +4,34 @@ slug: Web/API/Document/createEvent tags: - API - DOM - - Document - Method - Reference - - createEvent - メソッド +browser-compat: api.Document.createEvent translation_of: Web/API/Document/createEvent --- -
-

initCustomEvent など、createEvent とともに使用される多くのメソッドは非推奨です。代わりに イベントのコンストラクター を使用してください。

+
+

警告

+

createEvent とともに使用される多くのメソッド (initCustomEvent など) は非推奨です。代わりに イベントのコンストラクター を使用してください。

{{ApiRef("DOM")}}
-

指定された型の イベント を作成します。返されるオブジェクトは最初に初期化する必要があり、その後で {{domxref("EventTarget.dispatchEvent")}} へ渡すことができます。

+

指定された型の イベント を作成します。返されるオブジェクトは最初に初期化する必要があり、その後で {{domxref("EventTarget.dispatchEvent")}} へ渡すことができます。

-

構文

+

構文

-
var event = document.createEvent(type);
+
var event = document.createEvent(type);
 
    -
  • event は作成された イベント オブジェクトです。
  • +
  • event は作成された イベント オブジェクトです。
  • type は作成するイベント型を表す文字列です。取り得るイベント型は "UIEvents", "MouseEvents", "MutationEvents", "HTMLEvents" のいずれかです。詳しくは{{Anch("Notes", "注")}}の項目を参照してください。
-

+

-
// イベントを作成します。
+
// イベントを作成します。
 var event = document.createEvent('Event');
 
 // イベントの名前を 'build' に定義します。
@@ -46,62 +46,47 @@ elem.addEventListener('build', function (e) {
 elem.dispatchEvent(event);
 
-

+

createEvent() に渡すのに適したイベント型を表す文字列は DOM 標準で定義されています。ステップ 2 の表をご覧ください。現在はほとんどのイベントオブジェクトにコンストラクターがあり、それらはイベントオブジェクトのインスタンスを生成するために推奨される、現代的な方法であることに注意してください。

Gecko は非標準のイベントオブジェクトの別名をサポートしています。詳細は以下の表を参照してください。

- - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + +
イベントモジュール標準イベントオブジェクトGecko が対応する別名
テキストイベントモジュールTextEventTextEvents
キーボードイベントモジュールKeyboardEventKeyEvents
基本イベントモジュールEventEvents
イベントモジュール標準イベントオブジェクトGecko が対応する別名
テキストイベントモジュールTextEventTextEvents
キーボードイベントモジュールKeyboardEventKeyEvents
基本イベントモジュールEventEvents
-

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('DOM WHATWG', '#dom-document-createevent', 'document.createEvent')}}{{Spec2('DOM WHATWG')}}
+

仕様書

+ +{{Specifications}} -

ブラウザーの互換性

+

ブラウザーの互換性

-

{{Compat("api.Document.createEvent")}}

+

{{Compat}}

-

関連情報

+

関連情報

-- cgit v1.2.3-54-g00ecf