onresize Event in JavaScript
onresize Event in JavaScript
The onresize event is used to trigger when the browser window is resized. It is mostly used only on the body element.
Some size properties are:-
- clientWidth
- clientHeight
- innerWidth
- innerHeight
- outerWidth
- outerHeight
- offsetWidth
- offsetHeight
Syntax:-
Its syntax is:- < element onresize="my_script" > OR object.onresize= function(){my_script} OR object.addEventListener("resize", my_script)