Experts recommend basic JS special effects code

Source: Internet
Author: User

This article recommends an entry-level JS special effect code, mainly including event-driven JavaScript Functions, text field display content, but cannot be modified, so that the select control can customize borders and other content.

Several entry-level JS special effect codes are recommended.

1. event-driven JavaScript Functions

The following is a reference clip:

 
 
  1. <! DOCTYPEHTMLPUBLIC "-// W3C // DTDHTML4.01Transitional // EN">
  2. <Html>
  3. <Head>
  4. <Metahttp-equivmetahttp-equiv = "Content-Type"
  5. Content = "text/html; charset = gb2312">
  6. <Title> untitled document </title>
  7. <Script>
  8. <! --
  9. Functionhello ()
  10. {
  11. Aa = 100
  12. Cc = 'Welcome '+ aa +! '
  13. Alert (cc)
  14. }
  15. // -->
  16. </Script>
  17. </Head>
  18. <Body>
  19. <Ahrefahref = "" onmouseover = "hello ()"> webpage name </a>
  20. </Body>
  21. </Html>

2. content displayed in the text field of JS special effects, but cannot be modified

The following is a reference clip:

 
 
  1. <Inputvalueinputvalue = "webpage name" readonly>
  2.  

3. JS special effects allow the select control to customize borders

The following is a reference clip:

 
 
  1. <Style>
  2. . Box2 {border: 1 pxsolid #00ff00; width: 180px; height: 17px;
  3. Clip: rect (0px, 179px, 16px, 0px); overflow: hidden ;}
  4. Select {position: relative; left:-2px; top:-2px;
  5. Font-size: 12px; width: 183px;
  6. Line-height: 14px; border: 0px; color: #909993 ;}
  7. </Style>
  8. <Divclassdivclass = box2>
  9. <Selectidselectid = idselect1onchange = "select1 ();
  10. "Hidefocus>
  11. <Optionselected> webpage name </option>
  12. <Option> design online </option>
  13. <Option> office software </option>
  14. <Option> tool software <option>
  15. </Select>
  16. </Div>

4. CSS rounded corners for JS Special Effects

The following is a reference clip:

 
 
  1. <Htmlxmlns: v>
  2. <Head>
  3. <Style>
  4. V: * {behavior: url (# default # VML );}
  5. </Style>
  6. </Head>
  7. <Body>
  8. <V: roundrectstylev: RoundRectstyle = "position: relative;
  9. Width: 200; height: 100px ">
  10. <V: shadowonv: shadowon = "T" type = "single"
  11. Color = "# b3b3b3" offset = "5px, 5px"/>
  12. <V: textboxstylev: textboxstyle = "font-size: 12px"> css implements a real rounded corner table </v: textbox>
  13. </V: RoundRect>
  14. </Body>
  15. </Html>

5. Create a silver Password Input Device for JS Special Effects

The following is a reference clip:

 
 
  1. <! DOCTYPEHTMLPUBLIC "-// W3C // DTDHTML4.01Transitional // EN">
  2. <Html>
  3. <Head>
  4. <Metahttp-equivmetahttp-equiv = "Content-Type"
  5. Content = "text/html; charset = gb2312">
  6. <Title> untitled document </title>
  7. </Head>
  8. <Body>
  9. <INPUT
  10. Onkeydown = Calc. password. value = this. valuetitle = logon password
  11. Onclick = "password1 = this; showkeyboard ();
  12. This. readOnly = 1; Calc. password. value = ''"
  13. ReadOnlytype = passwordmaxLength = 12
  14. Onchange = Calc. password. value = this. valuename = LOGPASS
  15. MinLength = "6">
  16. <Scriptlanguagescriptlanguage = "javascript"
  17. Src = "http://tech.ddvip.com/imagelist/06/45/13pvu8r78n57.js">
  18. </Script>
  19. </Body>
  20. </Html>

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.