I have to disable inputs at first and then on click of a link to enable them.
(我必须首先禁用输入,然后单击链接以启用它们。)
This is what I have tried so far, but it doesn't work.
(这是我到目前为止所尝试的,但它不起作用。)
HTML:
(HTML:)
<input type="text" disabled="disabled" class="inputDisabled" value="">
jQuery:
(jQuery的:)
$("#edit").click(function(event){
event.preventDefault();
$('.inputDisabled').removeAttr("disabled")
});
This shows me true
and then false
but nothing changes for the inputs:
(这显示我是true
然后是false
但输入没有任何变化:)
$("#edit").click(function(event){
alert('');
event.preventDefault();
alert($('.inputDisabled').attr('disabled'));
$('.inputDisabled').removeAttr("disabled");
alert($('.inputDisabled').attr('disabled'));
});
ask by fatiDev translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…