JavaScript is the script language that runs on the browser side. JavaScript mainly solves the problem of Issues with front-end interaction with users, includingUsing interaction to interact with data. JavaScript is interpreted and executed by the browser. The front-end scripting language also includes JScript (unique to Microsoft and IE), ActionScript( Adobe company, plug-in required), etc.
Three blocks of front-end 1. HTML: page structure 2. CSS: page performance: element size, color, position, hiding or showing, partsAnimationEffect 3. JavaScript: PageBehavior: Some animation effects, interaction between the page and the user, page functions
Three ways to write JavaScript: embedded - external link - inline
Inline:
*
Write directly inside the tag"
onclick="alert('helloworld')""Embedded (embedded)
*
Writing method" <script><span style="font-family:Consolas; color:red; background:#F7F7F7"><strong> alert('hello world')</script> "* ##Note:
scriptCan be anywhere in html
External link style1.
Createjs File,Write jscode inside the file2. Pass "
## are divided into single-line comments and multi-line comments
Single-line comments//
Multi-line comments/ Content to comment /
The above is the detailed content of Detailed introduction to writing methods and comments in JavaScript. For more information, please follow other related articles on the PHP Chinese website!