0% found this document useful (0 votes)
26 views2 pages

PR 11

Uploaded by

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

PR 11

Uploaded by

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

11.

Develop a webpage for placing the window on the screen


and working with child window.

<!DOCTYPE>
<html >
<head>
<title>Raundal Yash Suresh Roll no:08</title>
</head>
<body>
<h1>Open Child Window</h1>
<button id="openWindow">Open Child Window</button>

<script>
document.getElementById('openWindow').addEventListener('click'
, () => {
const x = 100; // X position
const y = 100; // Y position

const childWindow = window.open('', 'Child Window',


`width=400,height=300,left=${x},top=${y}`);
if (childWindow) {
childWindow.document.write(`
<html>
<head>
<title>Child Window</title>
</head>
<body>
<h1>This is a Child Window</h1>
<button onclick="window.close()">Close</button>
</body>
</html>
`);
childWindow.document.close();
}
});
</script>
</body>
</html>

**********************************************************

You might also like