title: How to RestrictBlank Spaces In An Input Field In This Javascript?
body: <p>I believe it's a new request from what I've seen here. I'm using <code>onkeyup()</code> on one <code>input</code> to append and create a new value in a second <code>input</code>. It works great but I want to restrict white/blank spaces in the second <code>input</code>. See <a href="https://codepen.io/anon/pen/WXeRvb" rel="nofollow noreferrer">pen</a> here</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code> &lt;input type="text" id="fullnames" onkeyup="createUsername();" placeholder="Enter Your Full Name"&gt;
  
  &lt;!--restrict blank space--&gt;
  &lt;input type="text" id="username" placeholder="Username"&gt;
  </code></pre>
  
  <p><strong>Script</strong></p>
  
  <pre><code>    function createUsername() {
      var x = document.getElementById("fullnames").value;
      document.getElementById("username").value= x;
  }
  </code></pre>
  
  <p><strong>Final result</strong></p>
  
  <p>This is how it should be</p>
  
  <pre><code>Full Names : John Doe 
  Username : johndoe
  </code></pre>