Thread: button question
View Single Post
Old 01-11-2013, 10:45 PM   PM User | #1
diceman93
New to the CF scene

 
Join Date: Jan 2013
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
diceman93 is an unknown quantity at this point
button question

How's it going?!
Is there anyway to add a button in JS without adding it outside of the <script> tag? I know you can add it via <input type="button value="xxx" onClick="xxx"/>

I'm trying to make a program to learn about planets in our solar system. So i've created a switch case and would like the button to appear after it writes a bit of info about the planet on the page.
Example.

var planet= prompt(" Enter what planet you would like to learn about ");

switch(planet){
case "Mercury":
document.write(" info about planet... ");
// would like button to appear here after with a link to wiki regarding further info on the specified planet.
break;
etc. with cases..

Thanks in advance!
diceman93 is offline   Reply With Quote