JavaScript Basics, Login verification

Source: Internet
Author: User

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:

    1. Use the document.write () method to write content to an HTML document.
      <body><script>document.write (Date ()) </script></body>

    2. Use the Window.alert () pop-up warning box.
      <body><button type= "button" Onclick=window.alert ("Please wait ...") > Login </button></body>

    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.