Button Picks Random Select Item

[Total: 0    Average: 0/5]

This shows how to have a form use a button to automatically select an item in a select list.

Body Code:

<form name=exf1> 
<Select name=s1> 
<option >One</option > 
<option >Two</option > 
<option selected>Three</option > 
<option >Four</option > 
</select> 
<input type=button value='Random Select' 
onclick='document.exf1.s1.options[parseInt(Math.random()*4)].selected=true'> 
</form>

Times Viewed: 3

Leave a Reply

Your email address will not be published. Required fields are marked *