Hello world!
I am new to programming, and I need help with an assignment. I do not think my professor left us intentionally in the dust, but I believe he just hasn't covered this yet.
Anyways, we are creating a text adventure with html5/javascript and one of the objectives is to keep score when you click on an option. My options are go north, south, east, and west. On the first click to these areas you get 5 points, otherwise you only get 1 point. So far I only have this part of the code for score done:
function displayScore() {
alert ("Score");
}
document.write('<span id="score">Your score is '+score+'</span>');
This was in thanks to a fellow classmate, but I want to know how to finalize the code and know what each of these lines do. I do not necessarily need a popup to show the score, it could even be in a text field tag.
I'm sorry if I'm not using correct terminology, but the help would be greatly appreciated!
Thanks!