A Software Engineer Learns HTML5, JavaScript and jQuery: A by Dane Cameron

7. Save the file and close it. cross-reference • Task 10 introduces the creation of variables.

When specifying a number in JavaScript, you should not enclose the string in single or double quotes; if you do, it will be treated as a text string and not a number. 3” ab32 In the first case, the quotes make the value a text string, and in the second, the letters mean this is not a valid numeric value. write(375); You also use them as values assigned to variables: var aVar = 375; The following task shows how to create a variable containing a numeric value in a script: 1. Open a new HTML document in your preferred HTML or text editor.

Download PDF sample

Rated 4.94 of 5 – based on 7 votes