Search This Blog

select option in dropbox through javascript

Posted by Team on
If you want to select an option in your Dropdown box as you select that option from a link.
Here is solution......

I have used the code with onclick event you r free to use at any event.

Put this into Head section:

function setdate(num)

Put this into Body section:

<form name="f1" id="f1" >
<select name="selSS1" id="approxdate">
<option value="0">ha ha ha</option>
<option value="1">hi hi hi</option>
<option value="2">hu hu hu</option>
<option value="3">he he he</option>
<option value="4">ho ho ho</option>
<br /><br />

<a href="javascript:void(0);" onclick="javascript:setdate(0)">ha ha ha</a>
<br />
<a href="javascript:void(0);" onclick="javascript:setdate(1)">hi hi hi</a>
<br />
<a href="javascript:void(0);" onclick="javascript:setdate(2)">hu hu hu</a>
<br />
<a href="javascript:void(0);" onclick="javascript:setdate(3)">he he he</a>
<br />
<a href="javascript:void(0);" onclick="javascript:setdate(4)">ho ho ho</a>
<br />


     i ♥ i