Buttons are inevitably used in web page production. This article lists some commonly used button codes. View source code Here is a quote: Here is a quote: Here is a quote: Here is a quote: Here is a quote: Here is a quote: Here is a quote: Here is a quote: Here is a quote:
<input TYPE="button" NAME="view" VALUE="View source code" OnClick="window.location='view-source:' +window.location.href" >
Return to previous step
<input TYPE="button" VALUE="Back to previous step" ONCLICK="history.back(-1)">
Refresh button one
<input TYPE="button" VALUE="Refresh button one" ONCLICK="ReloadButton()">
<script language="JavaScript">
<!--
function ReloadButton(){location.href="3.html";}
// -->
</script>
Refresh button two
<p>
<input TYPE="button" VALUE="Refresh button two" onClick="history.go(0)">
Return to home page button
<input TYPE="button" VALUE="Home Button" ONCLICK="HomeButton()">
<script language="JavaScript">
<!--
function HomeButton(){location.href=http://www.aaa.com;}
// -->
</script>
Pop up warning box
<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
<p>
<input TYPE="button" VALUE="Status bar information" ONCLICK="StatusButton()">
<script language="JavaScript">
<!--
function StatusButton(){window.status="How are you?:)";}
// -->
</script>
background color change
<input TYPE="button" VALUE="Background color change" onClick="BgButton()">
<script language="JavaScript">
<!--
function BgButton(){
if (document.bgColor=='#3399ff')
{document.bgColor='#00ccff';}
else{document.bgColor='#3399ff';}
}
// -->
</script>
Open new window
<input TYPE="button" VALUE="Open 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>