0% found this document useful (0 votes)
8 views5 pages

Practical 11

Uploaded by

Priti Mane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Practical 11

Uploaded by

Priti Mane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Practical No:11

Name: Shraddha Pandit Hivare Roll No:18


<!DOCTYPE html>
<html>
<head>
<title>open and close window</title>
</head>
<body>
<h1> open and cloe window</h1>
<button onclick="openwindow()">open window</button>
<button onclick="closewindow()"> close window</button>
<script type="text/javascript">
var newwindow;
function openwindow()
{

newwindow=window.open("https://www.example.com","_blank","width=800,height=600")
}
function closewindow()
{
if(newwindow)
{
window.close();
}
else{
alert("no window to close");
}
}
</script>
</body>
</html>
Output:
<!DOCTYPE html>
<html>
<head>
<title>scrollTo</title>
<script type="text/javascript">
function scrollwindow()
{
scrollTo(0,20);

}
</script>
</head>
<body>
<p> click to scroll window </p>
<input type="button" value="scroll window" onclick="scrollwindow()"/>
<p>a</p>
<p>b</p>
<p>c</p>
<p>d</p>
<p>e</p>
<p> ...window is scrolled...</p>
</body>
</html>
Output:

<!DOCTYPE html>
<html>
<head>
<title>scrollby</title>
<script type="text/javascript">
function scrollwindow()
{
scrollBy(0,20);

}
</script>
</head>
<body>
<p> click to scroll window </p>
<input type="button" value="scroll window" onclick="scrollwindow()"/>
<p>a</p>
<p>b</p>
<p>c</p>
<p>d</p>
<p>e</p>
<p> ...window is scrolled...</p>
</body>
</html>

Output:

You might also like