Remove disabled attribute onClick of disabled form field

后端 未结 10 1474
眼角桃花
眼角桃花 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:09

    Citing Quirksmode.org:

    "A click event on a disabled form field does not fire events in Firefox and Safari. Opera fires the mousedown and mouseup events, but not the click event. IE fires mousedown and mouseup, but not click, on the form. All these implementations are considered correct."

    Quirksmode's compatibility table is great to find out more about such problems.

提交回复
热议问题