function MyFunction(){
var value = document.getElementById("Test").textContent;
document.getElementById("test2").value=value;
}
<p id="Test"> Is this what you want ? </p>
<button type="button" onclick="MyFunction()">Click</button><br><br>
<input type = "text" id="test2" name "teste2">