Seřazení čísel
Číslo 1:
Číslo 2:
Číslo 3:
Výsledek:
<script>
function vypocet() {
var a = parseInt(document.getElementById('a').value);
var b = parseInt(document.getElementById('b').value);
var c = parseInt(document.getElementById('c').value);
var docasna;
document.getElementById('vysledek').innerHTML = a.toString() + ", " + b.toString() + ", " + c.toString();
}
window.onload = function() {
document.getElementById('a').value = Math.round(100*Math.random());
}
</script>
Číslo 1:<input type="text" value="2" id="a">
<br>
Číslo 2:<input type="text" value="3" id="b">
<br>
Číslo 3:<input type="text" value="1" id="c">
<hr>
<button onClick="vypocet();">Seřaď čísla</button>
<br>
Výsledek:<span id="vysledek"></span>