I can't store value from input field

button value="" onclick = "testFunc()">test</button

<input  id="t1" value="">
<p id="t2">test</p

// I put < away from start to make it work
<script>

  function testFunc(){
     var testing = document.getElementById("t1").nodeValue;
     document.getElementById("t2").innerText = testing;
     alert(testing);
  }

I changed nodeValue to value and the code is now working. My text editor was giving me 2339 error with value but the code still worked I have no idea why value was giving red problem error.