Code for nine special effect buttons in Webpage Creation

Source: Internet
Author: User
The buttons are inevitable when creating web pages. This article lists some commonly used buttons. Code .

ViewSource code

The following is a reference clip:
<Input type = "button" name = "View" value = "view source code" onclick = "window. Location = 'view-Source: '+ window. Location. href">

Back to previous step

The following is a reference clip:
<Input type = "button" value = "back to the previous step" onclick = "history. Back (-1)">

Refresh button 1

The following is a reference clip:
<Input type = "button" value = "Refresh button 1" onclick = "reloadbutton ()">
<Script language = "JavaScript">
<! --
Function reloadbutton () {location. href = "3.html ";}
// -->
</SCRIPT>

Refresh button 2

The following is a reference clip:
<Input type = "button" value = "Refresh button 2" onclick = "history. Go (0)">

Home page button

The following is a reference clip:
<Input type = "button" value = "home page button" onclick = "homebutton ()">
<Script language = "JavaScript">
<! --
Function homebutton () {location. href = http://www.aaa.com ;}
// -->
</SCRIPT>

Pop-up warning box

The following is a reference clip:
<Input type = "button" value = "pop-up warning box" onclick = "alertbutton ()">
<Script language = "JavaScript">
<! --
Function alertbutton () {window. Alert ("have you drunk today? :)");}
// -->
</SCRIPT>

Status Bar Information

The following is a reference clip:
<Input type = "button" value = "status bar information" onclick = "statusbutton ()">
<Script language = "JavaScript">
<! --
Function statusbutton () {window. Status = "how are you? :)";}
// -->
</SCRIPT>

Background Color Conversion

The following is a reference clip:
<Input type = "button" value = "background color conversion" onclick = "bgbutton ()">
<Script language = "JavaScript">
<! --
Function bgbutton (){
If (document. bgcolor = '# 3399ff ')
{Document. bgcolor = '# 00ccff ';}
Else {document. bgcolor = '# 3399ff ';}
}
// -->
</SCRIPT>

Open new window

The following is a reference clip:
<Input type = "button" value = "open a new window" onclick = "newwindow ()">
<Script language = "JavaScript">
<! --
Function newwindow () {window. open (http://www.aaa.com, "", "Height = 600, width = 800, Left = 10, Top = 10, status = No, location = No, toolbar = No, directories = No, menubar = No ");}
// -->
</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.