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

https://jsfiddle.net/o80cqp4h/1/


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -