I want to append various things to an input with buttons.
button#addNumber -> appends 245
button#addOperation -> appends +
A problem arises with button#radicSign.
I want to add the template for a square root sqrt()
and place the caret inside the parentheses afterwards for the user to type in the number.
Is this possible?` If yes, is it worth the effort? Or should I open a dialog box and insert it then?
$('button#radicSign').on('click', function add2digit() {
addOperation('sqrt');
});
function addOperation(op) {
var problemInput = $('input#testProblem');
problemInput.val(problemInput.val() + op);
}