How To Change Button Text Using jQuery
> Here we consider how to change the button text using jQuery.
> Lets start with one example here.
> Suppose we have two buttons inside form as shown below.
Change Text of Input Button Using jQuery
> First of all consider input button.
> Here we can make use of jQuery prop or attr or jQuery Value attribute.
Using jQuery Value
$(function () {
$("#inputBtnID").val('New Value');
});
Using jQuery attr - Ver Older than 1.6
$(function () {
$("#inputBtnID").attr('value', 'New Value');
});
Using jQuery prop - Ver 1.6 +
$(function () {
$("#inputBtnID").prop('value', 'New Value');
});
Change Text of Normal Button Using jQuery
> Here we can make use of jQuery html attribute for changing the text.
$(function () {
$("#htmlBtnID").html('New Value');
});
> That's all, by using above methods, we can change the text of button using jQuery.
Watch Video of this Content on Video Steaming