Click here to Skip to main content
15,884,659 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a .JS with a lot of code.

And when I execute a function choose() { here! }

I want to appear in some kind of popup, some buttons, with three choices for example - I have already done the actions for those buttons.

I need that the most efficient possible, but with good looking.

I already used "standart" solutions like the confirm box:

C#
var answer = confirm ("Are you having fun?")
if (answer)
alert ("Woo Hoo! So am I.")
else
alert ("Darn. Well, keep trying then.")


that's not suitable to me because I the popup I want is to choose one between three colours! So I would like to post a square it a color (the button) and I cant do it with that solution!


What could I do?

Important thing: I need to stay on JS, no HTML allowed :)

Dont know JS enough to know what to look, so I appreciate your help !
Posted
Updated 5-Jan-11 8:00am
v2

1 solution

Typically this type of thing is accomplished with a div element that is displayed and floated whenever necessary. The entire thing could be constructed via javascript by creating elements and adding to the DOM, however, the easiest method is to construct the html before hand and hide/show as appropriate.
 
Share this answer
 
v2
Comments
fjdiewornncalwe 5-Jan-11 15:38pm    
Exactly what I was thinking.
Manfred Rudolf Bihy 5-Jan-11 17:02pm    
Agreed! 5+
Maxdd 7 5-Jan-11 19:47pm    
Perfect! thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900