title: JavaScript NextElementSibling not working
body: <p>I have several Javascript inputs inside of  elements, and s below them. </p>
  
  <p>I also have a javascript function which wipes the value of the input if there is a letter input into it, so that it only accepts numbers. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>t=function(elem){
  elem.onkeyup=function(e) {
    if(!/[\d\.]/.test(String.fromCharCode(e.which))) {
      elem.value='';
      x=elem.nextElementSibling;
      x.innerHTML='invalid string';
    }
  };
  };</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;dt&gt;
    &lt;input type='number' onkeyup='t(this)'/&gt;
   &lt;/dt&gt;
  &lt;dd&gt;
    text
    &lt;/dd&gt;
  &lt;dt&gt;
    &lt;input type='number' onkeyup='t(this)'/&gt;
    &lt;/dt&gt;
  &lt;dd&gt;
    text
    &lt;/dd&gt;
  &lt;!--comment--&gt;
  
  As you can see, if you type a letter into either input, it clears that input. </code></pre>
  </div>
  </div>
  </p>
  
  <p>As you can see, if you enter a letter into eithr input, it clears that input. I would like to change the innerHTML of the following</p>
  
  <pre><code>&lt;dd&gt;&lt;/dd&gt; 
  </code></pre>
  
  <p>element to 'invalid character', and you can see my attempt to do this on javascript lines 5 and 6. Why isn't this working? Any ideas? Know a fix?</p>
  
  <p>Regular/pure javascript answers only, please.</p>