2011-06-15 00:13:14 0 评论 jQuery Boy.Lee

使用 jQuery控制input输入框Disabled状态

{code}

//method one
$('#btn_next, #input_answer, #input_left').attr({'disabled':true});
$('#btn_next, #input_answer, #input_left').attr({'disabled':false});

//method two
$('#btn_next, #input_answer, #input_left').attr({'disabled':'disable'});
$('#btn_next, #input_answer, #input_left').removeAttr('disabled');

{Boy Said}

one from myself, the next one from yangmls, I thought the second method is good than the first one, and the method add attr and remove is good. thanks yangmls again.^&^