Tryit<!DOCTYPE html><html><head><title>Wikitechy onresize attribute</title></head><bodyonresize="onResize()"><p>Try to resize the browser window</p ><script>functiononResize()
{
alert ("You have changed the size of the Wikitechy window!");
}
</script></body></html>
Code Explanation for onresize Attribute in HTML:
The onresize attribute is used to call onresize() JavaScript function when browser window is resized.
The JavaScript function onresize is used to display an alert message.
Output for onresize Attribute in HTML:
If we resize the window, the alert box will appear along with the text shown in the output.