| The function included in the JavaScript code in the header which operates this operation is: |
| The HTML code below is: |
| Clicking the (JavaScript) button activates the function add(), using "this.form" establishes that everything sent to and returned from the function refers to this form. The function statement "says" to take the value of the text field in the form named "uno" and add it to the value of the text field named "duo" and then deposit it in the field named "result". |
| The function included in the JavaScript code in the header which operates this operation is: |
| The HTML code below is: |
| The only difference here is that eval() has been includedto tell JavaScript to treat the text fields as numbers. |
| The function included in the JavaScript code in the header which operates this operation is: |
| The HTML code below is: |
| Notice that we did not have to use eval() since JavaScript assumes that minus means that you are dealing with numbers. Notice, also, for the first time the form is not named, that is because you normally do not need to do so. An example, where the name is used but is otherwise identical to this follows. |
| The function included in the JavaScript code in the header which operates this operation is: |
| The HTML code below is: |
| Here we did not pass the form information to the function but instead used absolute addresses in the function to tell iT what to do to what and where to put it. |