
74451fbdaa76a02d1abf32ca4a1d3477.ppt
- Количество слайдов: 43
Default is Java. Script Comment symbols are used to hide the internal Java. Script code from browsers that do not support Java. Script
By convention, the extension is “. js” The closing tag is important
Functions can be called explicitly by using the name of the function, followed by parentheses that enclose any required arguments
The variable b is interpreted as a number for this operation, however the data type of b doesn't change. The value of c is 16 Both variables are interpreted as strings, and the value of c is ‘ 44’ PPK suggests using multiplication by 1 to convert a string to a number
This inline event handler calls the alert function whenever the user clicks the submit input element
The event handler can call any function that we added to the Java. Script code Function name Parentheses
An argument declared within the function definition Initializing a string variable The code in a function returns whenever it completes, and the keyword “return” is optional
The “new” operator instantiates an object and returns a reference to it that can be stored in a variable
The object A predefined browser object that represents the HTML page A method of the document object Value of the id attribute
A reference to the form object is passed as an argument to this function The "elements" node. List is a property of the form object
An Array object must be instantiated The length property contains the number of items in the array
Returns a node. List of all <p> elements
Testing for equality The "value" attribute of the text field with the name "quantity"
AND operator Both statements must be true
A single element can be retrieved by its “id” attribute
An element with this class will be invisible because its display is set to "none"
An element with this class will be visible because it sets the display to "block"
74451fbdaa76a02d1abf32ca4a1d3477.ppt