Window createPopup()Method
Window Object
Definition and Usage
The createPopup() method is used to create a popup window.
Syntax
window.createPopup()
Browser Support
![]()
![]()
![]()
![]()
![]()
Note:Only Internet Explorer supports the createPopup() method; other browsers do not support it.
Example
Example
Create a popup window:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (example.com)</title>
<script>
function show_popup(){
var p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="lime";
pbody.style.border="solid black 1px";
pbody.innerHTML="This is a popup! Click outside the popup to close.";
p.show(150,150,200,50,document.body);
}
</script>
</head>
<body>
<button onclick="show_popup()">Show popup!</button>
<p><b>Note:</b> createPopup() method only works in IE!</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Rookie Tutorial (example.com)</title>
<script>
function show_popup(){
var p=window.createPopup();
var pbody=p.document.body;
pbody.style.backgroundColor="lime";
pbody.style.border="solid black 1px";
pbody.innerHTML="This is a popup! Click outside the popup to close.";
p.show(150,150,200,50,document.body);
}
</script>
</head>
<body>
<button onclick="show_popup()">Show popup!</button>
<p><b>Note:</b> createPopup() method only works in IE!</p>
</body>
</html>
Try it Yourself »
Window Object Other Extensions