Wednesday, 27 October 2010

Change of plans

I decided to just use a set of pop ups instead, as I couldn't figure out how to link the forms to my javascript code.

This went into the header;
<script type="text/javascript">
    var text_name = prompt("Please type your name","type here");
    var text_animal = prompt("Please type your name","type here");
    var text_sport = prompt("Please type your name","type here");
    var text_food = prompt("Please type your name","type here");
    var text_eat = prompt("Please type your name","type here");
    var text_emotion = prompt("Please type your name","type here");
</script>

This then went into <script></script> tags after the <html> tags:
<script type="text/javascript">
    document.writeln(text_name + "decided to go for a walk with their" + text_animal + ", hoping to find a good location to play some " + text_sport + ". Unfortunately their " + text_animal + " became hungry, so it was given a " + text_food + " to " + text_eat + "  on for the journey.");
    document.writeln("The day passed and " + text_name + " did not find somewhere to play " + text_sport + ", so they felt very " + text_emotion + " and decided to head off back home.");
</script>

No comments:

Post a Comment