I'm create input form where user can add some text. if input value is empty, submit button is disabled, if text is entered submit button is enabled. my created code is working well, but when I use mobile or Touch view (chrome dev. tools toggle device toolbar) is not working.I think problem is Touch but i cant solve it.
$('#imgText').on('keyup keypress', function() {
if($(this).val().length >= 1) {
$("#generate-img").removeClass("no-click");
}
});
$('#imgText').on('keyup', function() {
if($(this).val().length == 0) {
$("#generate-img").addClass("no-click");
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>