Common JavaScript code (4): javascript code

Source: Internet
Author: User

Common JavaScript code (4): javascript code
The article is from "PHP100 Chinese network"


18. Change the button image.
<Style type = "text/css">
<! --
. Style3 {font-size: 12px; background: url (image/buttonbg1.gif); border: 0px; width: 60px; height: 22px}
. Style4 {font-size: 12px; font-weight: bold; background: url (image/buttonbg2.gif); border: 0px 0; width:

60px; height: 22px}
-->
</Style>
In this example, the button code is as follows:
<Input type = "submit" name = "Submit2" value = "submit" onmouseover = "this. className = 'style4 '"

Onmouseout = "this. className = 'style3'" class = "style3">

19. Print the page
<Div align = "center"> <a class = content href = "javascript: doPrint ();"> Print this article </a> </div>

20. You can directly write the html language.
Document. write ("");

21. change the color of the drop-down box.
<Select name = "classid"

OnChange = "changelocation (document. myform. classid. options [document. myform. classid. selectedIndex]. value )"

Size = "1" style = "color: #008080; font-size: 9pt">

22. Go to the target URL
Window. location = "http: // guoguo"

23. Pass the form of the object
UpdateSN ('guoqiang99267', this. form)
Function UpdateSN (strValue, strForm)
{
StrForm. SignInName. value = strValue;
Return false;
}

24. Text labels
<Label for = "AltName4"> <input name = "AltName" type = "RADIO" tabindex = "931" id = "AltName4"

> Guoqiang99859 </label>

25. layer2 is the component ID, which controls whether the component is visible.
Document. all. item ('layer2'). style. display = "block ";
Document. all. item ('layer2'). style. display = "none ";//

26. Add the page to favorite
<Script language = javascript>
<! --
Function Addme (){
Url = "http://your.site.address"; // your own home address
Title = "Your Site Name"; // Your own homepage Name
Window. external. AddFavorite (url, title );
-->
</Script> //

27. automatically close the page in 10 seconds
<Script language = "JavaScript">
Function closeit (){
SetTimeout ("self. close ()", 10000)
}
</Script>

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.