event.currentTarget is typically equal to this:
$("h1, h2, p").click(function(event){
alert(event.currentTarget ===
this);
});
Try it Yourself »
event.currentTarget プロパティは、イベント・バブリング・フェーズにおける現在の DOM 要素で、 一般的には this と同値です。
event.currentTarget
パラメータ | 説明 |
---|---|
event | 必須。event パラメータは、function にバインドしたイベント |
現在の要素を返す
要素のコンテンツを返すために event.currentTarget.innerHTML を使用します。