Web design templates - CD-44 Part II . JavaScript Tutorial Exercises 1.
CD-44 Part II . JavaScript Tutorial Exercises 1. Which of the following are valid variable declarations or initializations? Explain why each one is or is not valid. If an item is invalid, how do you fix it so that it is? a. my_name = Cindy b. var how many = 25 c. var zipCode = document.form1.zip.value d. var 1address = document.nameForm.address1.value 2. For each of the statements in the following sequence, write down how the someVal expression evaluates after the statement executes in JavaScript. var someVal = 2 someVal = someVal + 2 someVal = someVal * 10 someVal = someVal + 20 someVal = Robert 3. Name the two JavaScript functions that convert strings to numbers. How do you give the function a string value to convert to a number? 4. Type and load the HTML page and script shown in Listing 6-1. Enter a three- digit number into the top two fields and click the Add button. Examine the code and explain what is wrong with the script. How do you fix the script so the proper sum is displayed in the output field? Listing 6-1: What s Wrong with This Page?
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.