Remove disabled attribute onClick of disabled form field

后端 未结 10 1472
眼角桃花
眼角桃花 2020-12-03 11:28

I have a form field that starts out disabled and has an onClick to enable it. The onClick doesn\'t fire (at least in FF) nor does a simple alert(1);.

The hacky vers

10条回答
  •  时光说笑
    2020-12-03 12:17

    Enabling a disabled element on click kind of defeats the purpose of disabling, don't you think? If you really want the behavior you're describing, just style it 'disabled' and remove those styles on click.

提交回复
热议问题