I have some sort of calculator, and I need to insert .num-pad_number.html() into my input. Is that correct way to do this:
$("#num-pad").on("click", ".num-pad_number", function (event) {
$("#calc-input").val($("#calc-input").val() + $(this).html());
});
Or it may be more convinient and correct way? Cuz I have some bug with that solution. After some manipulations with websockets, "calculator" starts to duplicate every number, for example I need "5" but it insert "55".
'5' + '5' = '55' not 10;.text()not.html()since you won't be adding HTML, only the text content.