JS Knowledge Point

Source: Internet
Author: User


JS get Element
Document get element by id ' link ' obtains the element element by ID Connection//Documents document get Get
document.getElementById (' link '); Link is the name of an ID in HTML

Function call
1. Direct call to ABC ();
2. Event invocation
element. event = Fuction () {

}

If the script is placed inside the head, you need to add window.onload = function () {};
If you put it inside the body, you don't have to add

001

The ability to display a hyperlink's prompt message

Method 1

<!DOCTYPE HTML><HTML>      <Head>            <MetaCharSet= "UTF-8">            <title></title>            <styletype= "Text/css">#div1{width:100px;Height:100px;Background-color:#ccc;Border:1px solid: #DCECFA;Display:None;                  }            </style>            <Script>                  functionA () {document.getElementById ('Div1'). Style.display='Block'; }                  functionB () {document.getElementById ('Div1'). Style.display='None'; }            </Script>      </Head>      <Body>            <ahref="#"onmouseover= "A ()"onmouseout= "B ()">Website</a>            <DivID= "Div1" >for the security of your information</Div>      </Body></HTML>
Method 1

JS Knowledge Point

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.