title: jQuery remove first and last space on input propertychange
body: <p>I want to remove first and last space of any input on all the events (keyup/keydown/oncopy/onpaste etc).</p>
  
  <p>I have tried with below code but its not working.</p>
  
  <pre><code> $("body").on("input propertychange", "input", function (e) {               
                  if (e.which === 32 &amp;&amp; e.target.selectionStart === 0) {
                      return false;
                  }
   });
  </code></pre>