Home Back
     
 

 

 

Basismap Intra- Internet programmeren
Categorie Programmeren Onclick-voorbeelden
<html>
<head>
<Title>Onclick samples</Title>
</head>
<body>


Onclick history go back go forward

<form method="post">
<input type="button" value="BACK"  onclick="history.go( -1 );return true;">
<input type="button" value="FORWARD" onclick="history.go(  1 );return true;">
</form>

Onclick drop down-menu goto page ...

<form name="form1" method="post">
Select a page:

<select name="menu1" size="1">
<option value="http://address-page-1">Page 1</option>
<option value="http://address-page-2">Page 2</option>
<option value="http://address-page-3">Page 3</option>
</select>

<input type="button" onclick=  "location =  document.form1.menu1.options[document.form1.menu1.selectedIndex].value;"  value="GO">
</form>

onclick change backgroundcolor

<form name="test" method="post">
 <input type="button" value="White"  onclick="document.bgColor = '#FFFFFF';">
 <input type="button" value="Cyan"  onclick="document.bgColor = '#00FFFF';">
 <input type="button" value="Purple" onclick="document.bgColor = '#FF00FF';">
 <input type="button" value="Yellow" onclick="document.bgColor = '#FFFF00';">
</form>

onclick popup window

<form method="post">
<input type="button" value="Click me!"
onclick = "hint_wnd = window.open('', 'hint_wnd', 'width=50, height=60, resizable=no, scrollbars=no' );
hint_wnd.document.write( 'Hello, world!' );
return true;">
</form>


</body>
</html>  

Copyright (c) 2005 :: willems piet