I use the simple button as
<input type="button" value="Search" onclick="ajaxsubmit(this.form)" />
where function ajaxsubmit() looks like
function ajaxsubmit(f) {
$('#sendreq').attr("disabled", true);
$('#sendreq').val("Sending Request");
I want to style button onclick value (Sending Request) to change its color to red but the color of the initial button value (search) should not change
JS:
CSS (Text Color, use background-color if thats what you want. You can use any styles that should be applied):
Whenever you want to remove the red text, just call
.removeClass("redbutton")on your button element.