❗window-reflecting body element event handlers
browser ⟩ event ⟩ handler ⟩ window-reflecting body element event handlers
Window-reflecting body element event handlers:
if you assign one of the following event handlers on document.body, it will be reflected on window too, and vice versa.
onblur, onerror, onfocus, onload, onresize, onscroll
const body = document.body;
body.onblur = function f(){}; // assigned on body
window.onblur // f: reflected on window
window.onresize = function g(){}; // assigned on window
body.onresize // g: reflected on body
📗 Medium
Last updated
Was this helpful?