Hi,
I am trying to write this code which the value in the input field can be added on top each time when you get the value from links,
$(document).ready(function(){
autofill();
});
function autofill() {
$('.items-form a').click(function(){
var str = "";
str += $(this).attr('href') + " ";
$("#inputString").val(str);
return false;
});
}
<input type="text" size="30" value="" id="inputString" />
<div class="items-form">
<a href="arts">Arts</a>
<a href="design">Design</a>
<a href="vectors">Vectors</a>
<a href="games">Games</a>
<a href="science">Science</a>
</div>
what this code does so far is that it only change the value inside the input field each time I click on another links… what i have missed…?
any ideas will be much appreciated.
many thanks,
Lau