How do I change this javascript code so that the new page op
How do I change this javascript code so that the new page opens up blue?
function showWin() {
myWindow = window.open(\"\",\"width=2000,height=2000\"); //can\'t get this page to open up blue
myWindow.document.write(page);
}
Solution
If we have a HTML like below:
<input type=\"submit\" value=\"Show\" onClick=\"showWin()\"> // showWin() is used to open a new window on click of the button \"Show\"
So the javascript function goes like:
<script>
function showWin() {
myWindow = window.open(); // this will open a new window
myWindow.document.body.style.background =\"blue\"; // this will change the background color to Blue
}
</script>
