moveTo() and moveBy() using window in Javascript

 moveTo() and moveBy() using window in Javascript


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Testing Javsript</title>

</head>
<body >
 
<button onclick="func1()">CLICK ME TO OPEN GOOGLE</button>
<button onclick="func2()">moveTO</button>
<button onclick="func3()">moveBY</button>

<script>
    var a ;
function func1()
{
     a =  window.open("","_blank",
     "width=100px,height=100px,left=10px,top=10px");
     a.document.write("HELLO WORLD!!");
}

function func2()
{
      a.moveTo(100,100);
}
function func3()
{
      a.moveBy(200,200);
}

</script>

</body>
</html>
 
 
 

 

Comments

Popular posts from this blog