|
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!
|