InterviewSolution
Saved Bookmarks
| 1. |
Why Browser Object Model (BOM) introduced in JavaScript? |
|
Answer» The onresize event is executed a JavaScript when the browser window is resized. An example here displays the same: <!DOCTYPE html> <html> <head> <script> function display() { var a = "Window Width=" + window.outerWidth + ", Window Height=" + window.outerHeight; document.getElementById("myid").innerHTML = a; } </script> </head> <body onresize="display()"> <p>Resize browser window!</p> <p id="myid"> </p> </body> </html>The above displays the FOLLOWING OUTPUT when the window is resized: Resize browser window! Window Width=1366, Window Height=728 |
|