Personal questionnaire using JavaScript prompts This is just playing around and practicing javascript. I am learning JavaScript from Codecademy and I practice coding everyday so I can learn much as possible. I have a lot of if statements, prompt boxes, some alert boxes. I just got finished learning about functions and returns. I just don't know how to use the return in a browser for like document.write or even an alert box.

function prompter() {
    var toc = prompt("What do you prefer? Tea or Coffee");
    if ((toc == "tea") || (toc == "Tea")) {

    } else if ((toc == "coffee") || (toc == "Coffee")) {

    }
    var foc = prompt("What do you prefer? Facebook or MySpace");
    if ((foc == "facebook") || (foc == "Facebook")) {

    } else if ((foc == "myspace") || (foc == "Myspace")) {

    }
    document.write("&lt;center&gt;&lt;h2&gt;So you like " + toc + " and " + foc + " that is awesome.&lt;/h2&gt;&lt;/center&gt;");
}

function pickAColour() {
    var fun = prompt("What is your favorite colour? , mine is red.");
    document.write("&lt;center&gt;&lt;h2&gt;You like the colour " + fun + " that is a nice colour&lt;/h2&gt;&lt;/center&gt;");
}

function pickANumber() {
    alert("Lets do some math, do you like Math?");
    var pan = prompt("Please pick a number");
    var nap = prompt("Please pick another number");
    var symbol = prompt("Please pick one of the following symbols +  -  *  /");
    pan = parseInt(pan); //The parseInt() function parses a string and returns an integer.
    nap = parseInt(nap); //The parseInt() function parses a string and returns an integer.
    if (symbol == "+") {
        alert("You picked the Add symbol");
        alert("Lets add both these numbers together. " + pan + " " + symbol + " " + nap);
        document.write("&lt;center&gt;Your number is " + (pan + nap) + "&lt;/center&gt;");
    }
    if (symbol == "-") {
        alert("You picked the Minus symbol");
        alert("Lets Minus both of these numbers. " + pan + " " + symbol + " " + nap);
        document.write("&lt;center&gt;Your number is " + (pan - nap) + "&lt;/center&gt;");
    }
    if (symbol == "*") {
        alert("You picked the Multiply symbol");
        alert("Lets Multiply both these numbers. " + pan + " " + symbol + " " + nap);
        document.write("&lt;center&gt;Your number is " + (pan * nap) + "&lt;/center&gt;");
    }
    if (symbol == "/") {
        alert("You picked the Divide symbol");
        alert("Lets Divide both these numbers. " + pan + " " + symbol + " " + nap);
        document.write("&lt;center&gt;Your number is " + (pan / nap) + "&lt;/center&gt;");
    }
}

function run() {
    var name = prompt("What is your name?");
    document.write("&lt;h1&gt;&lt;center&gt;Welcome to this special JavaScript page " + name + "&lt;/center&gt;&lt;/h1&gt;");
    prompter();
    pickAColour();
    pickANumber();
    document.write("&lt;center&gt;Thank You for visting this page&lt;/center&gt;");
}

run();
You seem to be on the right track, at least with grasping how to do some basic coding. 

Right now, I only see one major issue: document.write()

document.write() is used to build pages out of javascript, something that is both impractical and ill-advised (in almost every situation). Moving forward, you should start building your pages in HTML and use javascript to tweak the page from that point.

To do this, you will want to replace document.write() with document.getElementById(). Lets look at an example:

You have the following HTML block:

&lt;h1 id='welcome'&gt;&lt;/h1&gt;


Now, to insert text into this block, we would do something like this:

var welcomeElement = document.getElementById('welcome');
welcomeElement.innerHTML = "This is my welcome message!";


There's many things you can do with elements once you have gotten them, but I'll leave that for a later experiment. 



At this point, I'll leave you to learn how to update your code. If you get confused or stuck however, you can view my rendition of your code here: 

http://jsfiddle.net/danthegoodman/v7gLE/