I am trying to set the text "sending..." with the following code snippets... https://bbbootstrap.com/snippets/awesome-chat-messages-box-43788219 Actually, I am creating my chatting system for my web application. can someone please help me to do so...

I tried the following code

<script type="text/javascript"> 
function changeText(submitId){
    var submit = document.getElementById(submitId);
    submit.value = 'Loading...';
    return false;
};
</script>

1 Answers

0
ellipsis On

Change the innerHTML instead of value

function changeText(submitId){
    var submit = document.getElementById(submitId);
    submit.innerHTML = 'Loading...';
    return false;
};
<button onclick="changeText(this.id)" id="submitId">Click</button>