What i want to achieve is similar to what you get when you are donating money, I want the user to pick the amount from a list and then the amount appears in the text input, so how is this done with javascript
html is below:
<div id="container">
<ul>
<li id="one"><a href="">$14</a> </li>
<li id="two"><a href="">$25</a></li>
<li id="three"><a href="">$36</a></li>
<li id="four"><a href="">$40</a></li>
<li id="five"><a href="">$200</a></li>
</ul>
<form method="post" action="" class="forms">
<label>
Amount Donated
<input id="value" type="text" name="amount" class="width-10" />
</label>
</form>
</div>
javascript below:
var amountClicked = document.getElementById("one");
if (amountClicked.clicked == true) {
document.getElementById("value").value = "$14";
}