How to change button value using jquery

I have another button on the page called “Edit” when I click the “Edit” button. I need to change the value of the Add button for SAVE ... using jquery ..

thank

+3
source share
2 answers
$('#edit_btn_id').click(function(){
    $('#badd').val('SAVE');
}
+8
source

You can use .val()to set the value of any input (including a button), for example:

​$("#badd").val("Save");​​​​​​

Try it here or just JavaScript:

document.getElementById("badd").value = "Save";
+8
source

Source: https://habr.com/ru/post/1757935/


All Articles