Jquery on click input does not work if input is disabled -
is there way tell jquery target elements disabled?
https://jsfiddle.net/o80cqp4h/
$(document).on("click", "input", function () { console.log('click'); $(this).prop('disabled', false); });
jquery ignores clicks on disabled elements (sort of), trick detect click higher chain, , find out if on input element:
$(document).on("click", function (e) { $clicked = $(e.toelement); if ($clicked.is("input:disabled")) { $clicked.prop('disabled', false); } });
if have support firefox, have hackier.
https://jsfiddle.net/o80cqp4h/3/ <-- firefox support
Comments
Post a Comment