2011-01-12 28 views

回答

5

你可以用$.attr()方法禁用它,

$("input.myBtn").click(function(){ 
    $(this).attr('disabled', true); 
}); 

或與$.replaceWith()法文本替換它。

$("input.myBtn").click(function(){ 
    $(this).replaceWith('<p>Processing your order. Please wait.</p>'); 
}); 
+0

'replaceWith'可能是最好考慮到OP請求。 :) –

1

使用jQuery:

$('#your-button-id').html('Please wait'); 
+0

這不會禁用它。 –

2
$('input:button').click(function() { 
    $(this).attr('disabled', true); 
});