我有这个代码
$('#addPhone').click(function() {
phoneCount = $("#phoneTabs").tabs("length") + 1;
$('#phoneTabs').show();
$('#phoneTabs').append('<div id="phoneTabs' + phoneCount + '"><form id="phoneForm' + phoneCount + '" novalidate="novalidate" action="" method="post"><table><tr><td><b>Phone Number ' + phoneCount + '</b></td><td></td></tr><tr><td>Phone number</td><td><input type="text" class="required digits" maxlength="10" minlength="10" name="phone_number' + phoneCount + '" /></td></tr><tr><td>Comment</td><td><textarea rows="5" cols="25" name="phone_comment' + phoneCount + '"></textarea></td></tr></table><br /><button id="addPhone' + phoneCount + '">Add</button></form></div>');
$("#phoneForm" + phoneCount).validate({
submitHandler: function() {
return false;
}
});
$('#addPhone' + phoneCount).button();
$('#addPhone' + phoneCount).click(function() {
$(this).button({
disabled: true
});
$('#phoneForm' + phoneCount + ' input').attr('disabled', true);
});
$("#phoneTabs").tabs("add", "#phoneTabs" + phoneCount, phoneCount);
$('#phoneTabs').tabs("select", phoneCount - 1);
phoneCount++;
});
为什么当我单击 addPhone 按钮时,只有按钮被禁用,为什么其他输入元素是 #phoneForm'+ phoneCount 的子元素没有被禁用?
我做错了什么?