Lecture notes - March 11
- Questions
- Text chap 10: "processing user input"
- output to HTML page: document.write("text");
n
- variables: var jimsName = "James Henri";
- string concatenation: "Jim's name is " + jimsName
- input from user: var jimsHeight = parseFloat( prompt("How tall is Jim?", "6") );
- function definitions: function someName(arg1, arg2){ ... }
- giving a tag an "id": <input id='thisOne' ...>
- a tag "object" in JS: var theInput = document.getElementById('thisOne');
- the text within an input object: theInput.value = "Hi!";
- hitting a button can call a JS function: <input type='button' onclick='doThis()'>
- Go over a few examples
- One: circle
- Two: circle2 - with errors
- Three: start of a Mastermind game - mastermind.html
Jim Mahoney
Last modified: Wed Mar 12 21:50:45 EST 2003