Here I have an input
with some buttons that enters text into it;
<input id="input"/>
<button onclick="enter('a')">a</button>
<button onclick="enter('b')">b</button>
<button onclick="enter('c')">c</button>
<script>
function enter(character){
document.getElementById("input").value+=character;
document.getElementById("input").focus();
}
</script>
I want to make these buttons enter a
, b
and c
where the cursor blinks, not at the back at the whole text. What script is needed to achieve this?