How to create a pop-up box in HTML.

I want to add a button which launches an error message pop-up box. (It's sort of a joke -- there would not be an actual error.)  How would I do this? Thanks!
MetajagAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
xabiConnect With a Mentor Commented:
You can do two things:

1st.-

Use a alert box.

<input type="button" Value="Click me" onclick="alert('Hands UP!')">

2.-

Open a Window without the toolbars, etc

<input type="button" Value="Click me" onclick="window.open('file.htm','_blank','menu=no,scrollbars=yes');

where "file.htm" must be a html file with the html you want inside you window.

Hope it helps

xabi
0
 
xabiCommented:
Sorry it was a mistake in the second option, sorry:

<input type="button" Value="Click me" onclick="window.open('file.htm','_blank','menu=no,scrollbars=yes')">

That's the right way

xabi

0
 
oubelkasCommented:
>> onclick="alert('Hands UP!')">

Haha Xabi, no podría usted encontrar cualquier cosa mejor?

Just kidding.... ;)

MetaJag> what Xabi explained to you can be your solution, another way (with more code) is to implement you own box with your own image in it. But see what you think of Xabi's solution.

Joseph
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
xabiCommented:
Joseph:

hahahah he needs it for a joke, so...

Sounds good,don't you think so?

xabi
0
 
oubelkasCommented:
Si, Xabi, agradable ;)

Joseph
0
 
MetajagAuthor Commented:
Gracias! Es muy agradable! I'll try the suggestions.  
0
All Courses

From novice to tech pro — start learning today.