jQuery change anchor tag href url via select option

<select name=”tpom” onchange=”$(‘#tpom_download’).attr(‘href’,this.value);”>
<option value=”media/tpom.mp3″>MP3</option>
<option value=”media/tpom.zip”>ZIP</option>
<option value=”media/tpom.m4a”>IPOD</option>
</select>
<div style=”float:left;width:75px;margin-top:-3px;”>
<ul name=”st_btn” style=”text-align: right; float: right;”>
<li name=”submit”> <a id=”tpom_download” title=”blah” href=”media/tpom.mp3″ onclick=”return false;”>Download</a></li>
</ul>
</div>

Tags: , , , ,

Leave a Reply

You must be logged in to post a comment.