2011-01-12 30 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); 
});