I think it is an easy questions but I am new in JavaScript
Why buttons "but3" and "but4" not working when I try moveBy or moveTo a new window?
thanks
HTML code
<input type="button" value="New window" id="but1" onclick="createwin()" />
<input type="button" value="close window" id="but2" onclick="closewin()" />
<input type="button" value="moveby window" id="but3" onclick="movebywin()" />
<input type="button" value="moveto window" id="but4" onclick="movetowin()" />
javascript code
var win1;
function createwin(){
win1 = window.open('http://www.google.com','google','width=500,height=500');
}
function closewin(){
win1.close();
}
function movebywin(){
win1.moveBy(100,100);
}
function movetowin(){
win1.moveTo(100,100);
}