<input type="text" placeholder="Skriv här!!">
<button type="button" onclick="skrivUt()">skriv ut</button>
<input type="text">

<script>
const skrivUt = () =>{
document.getElementsByTagName("input")[1].value = document.getElementsByTagName("input")[0].value;
};
</script>