Use a simple code demonstration to illustrate the commonly used properties and methods of the date object Date in JavaScript.
1. Open the text editor, create a new text document, and store it as a .html file, then create a new text document and store it as a .js file. The names of the two files can be arbitrary, but the suffixes must be .html and .js. Here, the Utilitied-1.html file is used to reference the Utilitied-1.js script for demonstration.
##2. Double-click to open the html file and proceed Code writing is mainly to implement references to js script files. The code is shown in the figure below, which is introduced in the <script></script> tag.
3. Then go back to the .js file and write the relevant code for the String object. Including properties, methods and other commonly used codes.
Simply use document.write() to output and see the effect. The code is shown below.4. Then find the location of the .html file, right-click, open properties, find the path, and copy it. Then paste it into the browser to see the effect, as shown in the picture below.
5. Finally, you can use shortcut keys directly in editplus. Select the .html file and press ctrl+b to directly edit it in editplus. Demonstrate in the built-in browser. The effect is the same, as shown in the picture below.
6. It should be stated that this is to demonstrate the knowledge to be shared, so only the part of the .html file is given Code, as for how to change the background color, the code may be attached later.
The above is the detailed content of Detailed explanation of navigato object of JavaScript object. For more information, please follow other related articles on the PHP Chinese website!