Here is a jsfiddle example of the problem I've been working on:
HTML:
<input type="text">
<input type="text">
<input type="text">
<div>
<button class="buttons">c</button>
<button class="buttons">a</button>
<button class="buttons">t</button>
</div>
JS:
$(document).ready(function () {
$('input').click(function(){
$(this).addClass('active').siblings('.active').removeClass('active')
});
$(".buttons").click(function () {
var cntrl = $(this).html();
$('input.active').append(cntrl);
});
});
I'm unable to get the button click to insert the clicked character into the textbox in the jsfiddle example. Any idea how to fix this?
appendwithval, this works for me. By works, i mean clicking a text box and then clicking a button inserts the buttons value into the text box.