<input id="tal1" type="text" placeholder="Tal 1">
<input id="tal2" type="text" placeholder="Tal 2">
<input id="tal3" type="text" placeholder="Tal 3">
<button type="button" onclick="compare()">Skriv i ordning</button>

<div id="output1"></div>
<div id="output2"></div>
<div id="output3"></div>

<script>
const compare = () =>{
const tal1 = parseInt(document.getElementById("tal1").value);
const tal2 = parseInt(document.getElementById("tal2").value);
const tal3 = parseInt(document.getElementById("tal3").value);

let output1 = document.getElementById("output1");
let output2 = document.getElementById("output2");
let output3 = document.getElementById("output3");

const sorted = [tal1,tal2,tal3].sort(function(a, b){
return a - b
})

output1.innerHTML = sorted[0]
output2.innerHTML = sorted[1]
output3.innerHTML = sorted[2]
}
</script>