jsp--Learning article: using JavaScript simply

Source: Internet
Author: User

JavaScript is a scripting language for Web pages that supports the development of client and server applications and artifacts! It is an explanatory language that needs to be compiled before it can be run!

The specific syntax is not here to explain! JavaScript is used in Web pages in two ways: directly into the Web page and by reference! I simply use, usually with the first way to join the page directly!

The following is a simple use of JavaScript to check whether the page form input is empty and the effect code map:

1 <HTML>2 <Head>3 </Head>4 <Body>5 <Scriptlanguage= "JavaScript">6 functionCheckform () {7 if(Document.myForm.username.value== "") {8 Alert ("Please enter a title!!!");9 Document.myform.title.focus ();Ten     return false; One } A return true; - } - </Script> the <H1Align= "Center">Login interface</H1> - <HR> - <Center> - <formname= "MyForm"Action="#"Method= "POST"OnSubmit= "return Checkform ()"> +User name:<inputname= "username"type= "Text" /><BR> -Dense&nbsp;Code:<inputname= "Password"type= "Password"/><BR> + <inputvalue= "Login"type= "Submit" /> A <inputvalue= "Register"type= "Submit" /><BR> at </Center> - </Body> - </HTML>

Here is simply the use and introduction, we are interested in going deep to learn ha!!!

jsp--Learning article: using JavaScript simply

Related Article

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.