1, <script></script> three ways to use:
A put in <body>
<body>
<p id= "Meto" > Standard Beijing time </p>
<script >
document.getElementById (' Meto '). InnerHTML = Date ()
</script>
<script type= "Text/javascript" >alert ("Guangzhou Business School") </script>
</body>
b put in
C placed in JS file
Three ways to output data:
- Use the document.write () method to write content to an HTML document.
<body><script>document.write (Date ()) </script></body>
- Use the Window.alert () pop-up warning box.
<body><button type= "button" Onclick=window.alert ("Please wait ...") > Login </button></body>
- Writes to an HTML element using InnerHTML.
<body><p id= "Meto" > China Standard Time </p><script>document.getelementbyid ("Meto"). Innerhtml=date () </script></body>
3, 4, 5 questions
<! DOCTYPE html>function Fnlogin () { var ouname = document.getElementById ("uname") var oupass = document.getElementById ("UPass ") var oerror = document.getElementById (" Error_box ") if (OUname.value.length > 20 | | OUname.value.length < 6) { oerror.innerhtml = "Please enter user name 6-20-bit character" } if (OUpass.value.length > | | oupass . value.length < 6) { oerror.innerhtml = "Please enter password 6-20-bit character" }}
JavaScript Basics, Login verification