title: How to difference in an if clause between an input value or td text content in javascript
body: <p>Hello and thank you for take your time reading my issue.</p>
  
  <p>I'm trying to set values to a matrix in the loop below:</p>
  
  <pre><code>for(var i=0; i&lt;9; i++){
      for(var j=0;j&lt;9;j++){
          var aux = i.toString().concat(j.toString());
          // If that I want
          var num = document.getElementById(aux).innerText;
          matriz[i][j] = num;
          // else
          var num = document.getElementById(aux).value;
          matriz[i][j] = num;
  
      }
  }
  </code></pre>
  
  <p>I have this table in HTML (I'm not going to copy all the table):</p>
  
  <pre><code>&lt;table id="tablero"&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;input id="00" type="text" maxlength="1"&gt;  &lt;/td&gt;
      &lt;td id="01"&gt;&lt;/td&gt;
      &lt;td id="02"&gt;&lt;/td&gt;
      &lt;td id="03"&gt;&lt;/td&gt;
      &lt;td id="04"&gt;&lt;/td&gt;
      &lt;td&gt; &lt;input id="05" type="text" maxlength="1"&gt;&lt;/td&gt;
      &lt;td&gt; &lt;input id="06" type="text" maxlength="1"&gt;&lt;/td&gt;
      &lt;td id="07"&gt;&lt;/td&gt;
      &lt;td&gt; &lt;input id="08" type="text" maxlength="1"&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td id="10"&gt;&lt;/td&gt;
      &lt;td&gt; &lt;input id="11" type="text" maxlength="1"&gt; &lt;/td&gt;
      &lt;td&gt; &lt;input id="12" type="text" maxlength="1"&gt; &lt;/td&gt;
  ..
  </code></pre>
  
  <p>The td's without inputs have default values.
  So, how can I differentiate them in the previous loop? Thanks in advance</p>