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:
- <! DOCTYPEHTMLPUBLIC "-// W3C // DTDHTML4.01Transitional // EN">
- <Html>
- <Head>
- <Metahttp-equivmetahttp-equiv = "Content-Type"
- Content = "text/html; charset = gb2312">
- <Title> untitled document </title>
- <Script>
- <! --
- Functionhello ()
- {
- Aa = 100
- Cc = 'Welcome '+ aa +! '
- Alert (cc)
- }
- // -->
- </Script>
- </Head>
- <Body>
- <Ahrefahref = "" onmouseover = "hello ()"> webpage name </a>
- </Body>
- </Html>
2. content displayed in the text field of JS special effects, but cannot be modified
The following is a reference clip:
- <Inputvalueinputvalue = "webpage name" readonly>
-
3. JS special effects allow the select control to customize borders
The following is a reference clip:
- <Style>
- . Box2 {border: 1 pxsolid #00ff00; width: 180px; height: 17px;
- Clip: rect (0px, 179px, 16px, 0px); overflow: hidden ;}
- Select {position: relative; left:-2px; top:-2px;
- Font-size: 12px; width: 183px;
- Line-height: 14px; border: 0px; color: #909993 ;}
- </Style>
- <Divclassdivclass = box2>
- <Selectidselectid = idselect1onchange = "select1 ();
- "Hidefocus>
- <Optionselected> webpage name </option>
- <Option> design online </option>
- <Option> office software </option>
- <Option> tool software <option>
- </Select>
- </Div>
4. CSS rounded corners for JS Special Effects
The following is a reference clip:
- <Htmlxmlns: v>
- <Head>
- <Style>
- V: * {behavior: url (# default # VML );}
- </Style>
- </Head>
- <Body>
- <V: roundrectstylev: RoundRectstyle = "position: relative;
- Width: 200; height: 100px ">
- <V: shadowonv: shadowon = "T" type = "single"
- Color = "# b3b3b3" offset = "5px, 5px"/>
- <V: textboxstylev: textboxstyle = "font-size: 12px"> css implements a real rounded corner table </v: textbox>
- </V: RoundRect>
- </Body>
- </Html>
5. Create a silver Password Input Device for JS Special Effects
The following is a reference clip:
- <! DOCTYPEHTMLPUBLIC "-// W3C // DTDHTML4.01Transitional // EN">
- <Html>
- <Head>
- <Metahttp-equivmetahttp-equiv = "Content-Type"
- Content = "text/html; charset = gb2312">
- <Title> untitled document </title>
- </Head>
- <Body>
- <INPUT
- Onkeydown = Calc. password. value = this. valuetitle = logon password
- Onclick = "password1 = this; showkeyboard ();
- This. readOnly = 1; Calc. password. value = ''"
- ReadOnlytype = passwordmaxLength = 12
- Onchange = Calc. password. value = this. valuename = LOGPASS
- MinLength = "6">
- <Scriptlanguagescriptlanguage = "javascript"
- Src = "http://tech.ddvip.com/imagelist/06/45/13pvu8r78n57.js">
- </Script>
- </Body>
- </Html>