current position:Home>Introduction to JavaScript

Introduction to JavaScript

2022-05-15 04:32:34The evening wind blows

One 、 First time to know JavaScript

JavaScript It's script language , Insert html Use in

Two 、 Use JavaScript

1、 Must be in script Between the labels
2、 Can be placed in HTML Page body and head part

  1. Must be in script Between the labels

    <script> <p> first JavaScript</p> </script>
    
  2. Can be placed in HTML Page body and head part

    example : place body in

    <!DOCTYPE html>
    <html>
    <body>
    <script> document.write("<h1> first JavaScript</h1>"); document.write("<p> first JavaScript</p>"); </script>
    </body>
    </html>
    

    example : place head in

    <!DOCTYPE html>
    <html>
    <head>
    <script> document.write("<h1> first JavaScript</h1>"); document.write("<p> first JavaScript</p>"); </script>
    </head>
    <body>
    </body>
    </html>
    

3、 ... and 、 function JavaScript

 Insert picture description here

copyright notice
author[The evening wind blows],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/135/202205142149360032.html

Random recommended