Thank you for you suggestion Panoptik, adding readonly
on focusin
, and then removing it on focusout
was the cleanest way, million thanks! I answer myself in case anyone has the same problem. Hope it helps.
$(document).on("focusin", "#someid", function() {
$(this).prop('readonly', true);
});
$(document).on("focusout", "#someid", function() {
$(this).prop('readonly', false);
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…