Javascript code for creating a POP-UP window

We have already seen about creating a POP-UP menus using javascript.

Let us see how to create a POP-UP window using javscript.

Now we are going create code html file and we are going to add the link, whenever the user clicks the link it will display the POP-UP window

Place the code inside the html file

<html>
<body>
<a href="javascript: void(0)" onclick="window.open('index.php', 'windowname1', 'width=750, height=800, scrollbars=no'); return false;">Learn web development</a>
</body>
</html>

Save the html file.

Lets us see the detailed explanation about the parameters used in POP-UP window
1. onclick=window.open() – It lets to open a new POP-UP window
2. “help.php” – Include your source file on click it has to opened
3. width and height- You can able to adjust the size of the window
4. scrollbars – If you want the window to scrollable set the value to ‘yes

Live demo
Quotes Gallery

Posted in Javascript Tagged with: , ,