# Button Click, Message Pop Up - Simple Website



## em1 (Mar 18, 2005)

Is there a template or a simple code I can use for the following....

I want to create a page with a button and when you click a button a message pops up, click it again, another message pops up...etc... So the button would have to pull from a set of data

In my head it seems simple enough, any templates out there?


----------



## Laxer (Dec 28, 2010)

Template no, but you could use a simple javascript/form to accomplish it.

Html:

```
<form>
<input type="button" onclick="popup();" value="popup" />
</form>
```
Javascript:

```
function popup(){
alert("I am a popup!");
}
```
To make it do multiple popups you would need some kind of if/else structure or a loop.

W3S example: JavaScript Popup Boxes


----------

