PerformanceEventTiming: target プロパティ
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
読み取り専用の target
プロパティは、関連付けられたイベントの最後の target
(イベントが最後に配信されたノード)を返します。
値
例
特定の最後のターゲットを持つイベントの監視
target
プロパティはイベントタイミング項目 (PerformanceEventTiming
) を監視するときに使用することができます。例えば、指定された最後の対象に対してのみイベントをログ出力し、測定する場合などです。
js
const observer = new PerformanceObserver((list) => {
list.getEntries().forEach((entry) => {
if (entry.target && entry.target.id === "myNode") {
const delay = entry.processingStart - entry.startTime;
console.log(entry.name, delay);
}
});
});
// イベントのオブザーバーを登録
observer.observe({ type: "event", buffered: true });
仕様書
Specification |
---|
Event Timing API # dom-performanceeventtiming-target |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
target |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.