How to write javascript: first create a new html file; then write the js code in [<script type="text/javascript"></script>]; finally test whether it is successful.
The operating environment of this tutorial: Windows 7 system, JavaScript version 1.8.5, DELL G3 computer.
How to write javascript:
1. First write an ordinary html. The following is the simplest html as an example.
#2. Write a js above it. Everyone should write js code in <script type="text/javascript"></script>
.
#3. Write a simple pop-up box in js. The pop-up box is alert('');
Enter what you want to write.
4. Whether the test is successful.
5. Click OK to display the content written on our web page
The above is the detailed content of How to write javascript. For more information, please follow other related articles on the PHP Chinese website!