JQuery Reload button and change value -


hello i'm making chat app using long-polling, ajax etc.

what wanted when clicked "send" button wanted value of button changed "please wait.." , refreshed , go value "send".

for code when "send" button clicked:

$('#btnsend').val('please wait..'); 

it work won't "send" value. thoughts? thanks!

$('#btnsend').on('click', function() {     $(this).val('please wait...').prop('disabled', true);      // processing here e.g. ajax      // when completed      $(this).val('send').prop('disabled', false); }) 

Comments