Содержание
- 2. Which one is legal? My_variable $my_variable 1my_example _my_variable @my_variable My_variable_example ++my_variable %my_variable #my_variable ~my_variable myVariableExample
- 3. For Loop A loop is a block of code that allows you to repeat a section
- 4. Why loops are useful? Loops are useful because they allow you to repeat lines of code
- 5. For loop for (initial_expression; test_exp; change_exp) { statements; } One of the most used and familiar
- 6. For loop for ( varname=1;varname initialization Tells the loops when to stop running Determines the rate
- 7. For loop Example var counter; for (counter = 1; counter { document.write(counter*counter + “ “); }
- 8. A while loop just looks at a short comparison and repeats until the comparison is no
- 9. While loop example While loop example var counter = 100; var numberlist = “”; while (counter
- 10. Do…while loop The do/while loop always executes statements in the loop in the first iteration of
- 11. Do…while example
- 12. Array An Array contains a set of data represented by a single variable name. Arrays in
- 13. Array Example Car = new Array(3); Car[0] = “Ford”; Car[1] = “Toyota”; Car[2] = “Honda”; document.write(Car[0]
- 14. Array You can also declare arrays with variable length. arrayName = new Array(); Length = 0,
- 15. Events The most exciting JavaScript-powered pages are dynamic. Which means they perform various actions as your
- 16. Syntax
- 17. Common HTML Events The other events we can find here: https://www.w3schools.com/jsref/dom_obj_event.asp
- 18. Example
- 19. Common HTML object events
- 20. Onclick event
- 21. Exercise When the button is clicked, trigger myFunction() with an event.
- 22. Mouse Events
- 23. Keyboard Events
- 24. onFocus event
- 25. onblur event Execute a JavaScript when a user leaves an input field:
- 26. onchange event
- 27. Frame/Object Events
- 28. Form Events
- 30. Скачать презентацию