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> |