$(".inv_item").click(function(event){ $(".set_input").val($(this).children("p").html() + "/"); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button class=inv_item>Добавить<p> этот текст</button> <input value="тут уже что-то есть" class=set_input> Actually in this code, when you click on .inv_item, the text is entered into the input with the class .set_input. But the problem is that with each press, the text in the input is replaced with a new one, but I need the old text not to be deleted and the new one added after it.