JavaScript introductory practice code notes

Summary: By learning to quickly understand JavaScript, familiar with the basic syntax of JavaScript, window interaction methods, and the operation of web page elements through DOM, learn how to write JS code, how to use JavaScript to manipulate HTML elements and CSS styles, JavaScript entry is divided into four chapters , Allows you to get started quickly, and lay the foundation for in-depth learning of JavaScript.

Chapter 1 Please be prepared

This chapter mainly explains how to add JavaScript code to HTML files and master the necessary basic grammar

  • 1-1 Why learn JavaScript
  • 1-2 Where are you new friends (how to insert JS)
  • 1-3 I can also stand alone (reference external JS files)
  • 1-4 Find your location (JS position on the page)
  • 1-5 JavaScript-recognize sentences and symbols
  • 1-6 JavaScript-Comments are important
  • 1-7 JavaScript-What is a variable
  • 1-8 JavaScript-judgment statement (if ... else)
  • 1-9 JavaScript-What is a function

Chapter 2 Please interact with me (common interaction methods)

This chapter mainly explains how to input content into the web page and how to interact with the browser window, which can be easily achieved through a simple object method.

  • 2-1 JavaScript-output content (document.write)
  • 2-2 JavaScript-Warning (alert message dialog)
  • 2-3 JavaScript-confirmation (confirm message dialog)
  • 2-4 JavaScript-Question (prompt message dialog)
  • 2-5 JavaScript-Open a new window (window.open)
  • 2-6 JavaScript-Close window (window.close)
  • 2-7 Programming exercises

Chapter 3 You also have control (DOM manipulation)

How to use JavaScript to manipulate HTML elements and CSS styles to achieve simple dynamic operations.

  • 3-1 Know DOM
  • 3-2 Get elements by ID
  • 3-3 innerHTML property
  • 3-4 Change HTML style
  • 3-5 Show and hide (display attribute)
  • 3-6 Control class name (className attribute)

Chapter 4 Programming Challenge

Continue to practice and improve skills.

  • 4-1 Programming Challenge

JavaScript entry practice code notes (click to download)

Guess you like

Origin www.cnblogs.com/dhnblog/p/12677077.html