DOM getElementById

Source Code

    <input name="test" type="text" value="name is test" />
    <input id="test" type="text" value="id is test" />
    <p id="output"></p>
    <script>
        document.getElementById("output").innerHTML = document.getElementById("test").value;
    </script>
    

Result