javascript-Classic Examples

Source: Internet
Author: User

1. Text Box Focus Issues
OnBlur: This event occurs when the input focus is lost onfocus: When the input has the focus, the file is Onchange: When the literal value changes, the event is generated Onselect: When the text is highlighted, the file is generated
<input type= "text" value= "Guo Qiang" onfocus= "if (value== ' Guo Qiang ') {value= '}" onblur= "if (value== ') {value= ' Guo Qiang '}" > Text disappears when clicked , the text appears again when you lose focus
2. Special colors for Web buttons
<input Type=button name= "Submit1" value= "Guo Qiang" size=10 class=s02
Style= "
3. Color changes when mouse moves in and out
<input type= "Submit" value= "Find" name= "B1" onmouseout=this.style.color= "Blue"
Onmouseover=this.style.color= "Red" class= "button" >
4. Flat button
<input type=submit value= Subscription style= "border:1px Solid: #666666; height:17px; width:25pt; font-size:9pt;
#E8E8FF; Color: #666666 "name=" Submit ">
5. Button color change
<input type=text name= "Nick" style= "border:1px solid #666666;  font-size:9pt; height:17px;
#F4F4FF; Color: #ff6600 "size=" > "maxlength="
6. Flat input Box
<input type= "text" name= "T1" size= "style=" border-style:solid; Border-width:1 ">
7. Turn the window into a specified size <script>
Window.resizeto (300,283); </script>
8. Scroll the text up and down <marquee direction=up scrollamount=1 scrolldelay=100 onmouseover= ' this.stop () '

Height=60>

<!--head_scrolltext--<tr> <td> Republic
</table> <!--end Head_scrolltext--</marquee>
9. Status bar Displays the page status
<base onmouseover= "window.status=" website construction http://www.webmake.cn/' return true ' >
10. You can click the text to achieve the selection of radio options <br>
&nbsp;&nbsp;&nbsp;&nbsp;<input type= "Radio" name= "Regtype" value= "A03" id= "A03" > <label for = "A03" > Couple: Register two accounts at a time </label> <br>
11. You can write the onclick event in the font of the text field
12. Print </a> Print web pages
<a href= ' javascript:window.print () ' >
13. Line Input Box
<input type= "text" name= "key" size= "" value= "keyword" onfocus=this.select () Onmouseover=this.focus ()
class= "line" >
14. Display document last Modified date <script language=javascript> function hi (str) {
document.write (document.lastmodified)
Alert ("HI" +str+ "!")}
</script>

javascript-Classic Examples

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.