My question is sort of complex but I will try to word as best I can.
I am making a website with that involves a lot of javascript. I don't have everything setup so some of the scripts aren't hooked up with anything. I want to make a popup console that will allow me to type in what function I want the computer to preform and have the computer do so.
Can I have a variable and then call a function with that variable example:
var CodeApprentice = "Cat"; function Cat(){ document.write("kitten"); } function Dog(){ document.write("puppy"); } //Here is were I want to call the function with the variable CodeApprentice // and have it do the cat function function CodeApprentice();
I know I am not doing this correctly, but is there a way to do this or am I just crazy?