code as follows
Open
var myWindow;
function openWin() {
myWindow = window.open("", "myWindow", "width=200,height=100");
myWindow.document.write("
This is 'myWindow'
");
}
i have one button callled open
when i click that i have to open a new window
for that i written a above code.
when i run the code shows error as follows
Uncaught ReferenceError: openWin is not defined at HTMLButtonElement.onclick
please help me what is the mistake in my above code
What I have tried:
code as follows
Open
var myWindow;
function openWin() {
myWindow = window.open("", "myWindow", "width=200,height=100");
myWindow.document.write("
This is 'myWindow'
");
}
i have one button callled open
when i click that i have to open a new window
for that i written a above code.
when i run the code shows error as follows
Uncaught ReferenceError: openWin is not defined at HTMLButtonElement.onclick
please help me what is the mistake in my above code