LayoutShiftAttribution: node property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{APIRef("Performance API")}}{{SeeCompatTable}}
The **node** read-only property of the {{domxref("LayoutShiftAttribution")}} interface returns a {{domxref("Node")}} representing the object that has shifted.
Value
A {{domxref("Node")}}.
Examples
The following example prints the node of the first item in {{domxref("LayoutShift.sources")}} to the console.
js
new PerformanceObserver((list) => {
for (const { sources } of list.getEntries()) {
if (sources && sources.length > 0) {
console.log(sources[0].node);
}
}
}).observe({ type: "layout-shift", buffered: true });Specifications
{{Specifications}}
Browser compatibility
{{Compat}}