title: How to fix jQuery 'length' of undefined problem in browser mobile view?
body: <p>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.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#imgText').on('keyup keypress', function() {
    if($(this).val().length &gt;= 1) {
        $("#generate-img").removeClass("no-click");
      }
  });
  $('#imgText').on('keyup', function() {
    if($(this).val().length == 0) {
      $("#generate-img").addClass("no-click");
    }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://i.stack.imgur.com/tC3CE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tC3CE.png" alt="enter image description here"></a></p>