2
如何啓用上的鏈接按鈕,點擊文本框,我禁用文本框在HTML使用jQuery啓用按鈕,文本框,單擊
這裏是jQuery代碼我試圖使用方法:
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#lEdit').click(function() {
$('#CorporationName').removeAttr('disabled');
});
});
</script>
<asp:LinkButton ID="lEdit" runat="server" ClientIDMode="Static" >Edit</asp:LinkButton>
<asp:Label ID="lblCorporationName" runat="server" Text="Corporation Name" Width="130px"></asp:Label>
<asp:TextBox ID="CorporationName" runat="server" Width="250px" ClientIDMode="Static" Enabled="false"></asp:TextBox>
實際上,建議您不要將它用於此目的。從[.removeProp()](http://api.jquery.com/removeProp/):_注意:不要使用此方法刪除本機屬性,如選中,禁用或選中。這將完全刪除該屬性,一旦刪除,不能再添加到元素。使用.prop()將這些屬性設置爲false ._ – 2013-02-08 22:53:44
@rub - 看起來您是正確的...感謝您的反饋。 – Lix 2013-02-08 23:03:45