How to use Window Object CreatePopup in JavaScript

In this article I am going to explain about window object CreatePopup() Method in JavaScript.
  • 1736

JavaScript Window Object CreatePopup Method

JavaScript CreatePopup() method use for create pupop window. After creating pupup window when we you will click outside from pupup window then window will be close. CreatePopup() method only work in IE.

Syntax

Window.CreatePopup()

Example

<html>

<head>

<script type="text/javascript">

    function myfun() {

        var p = window.createPopup();

        var pupup = p.document.body;

        pupup.style.backgroundColor = "skyblue";

        pupup.style.border = "solid black 2px";

        pupup.innerHTML = "This is the pupup window";

        p.show(75, 100, 200, 50, document.body);

    }

</script>

</head>

 

<body>

<button onclick="myfun()">click me</button>

<p>click on the button for open pop-up window and<br /> click out side screen for close</p>

</body>

 

</html>

 

Output

 

popup.gif


You may also want to read these related articles: here
 
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2013 dotNetheaven. All rights reserved.