Czesc forumowicze. Zaczalem ogladac kurs pana Miroslawa dotyczacy js'a i mam pewien problem. Otoz zrobilem taki formularz w html:
<body>
<input type="text" id='first' value="">
<input type="text" id='second' value="">
<input type="button" onclick="numbers()" value="check">
<div id="box">
</div>
</body>
oraz kod js'a:
function numbers() {
var tmp1 = document.getElementById("first").value;
var tmp2 = document.getElementById('second').value;
if (tmp1 > tmp2) {
document.getElementById("box").innerHTML = tmp1;
} else {
document.getElementById('box').innerHTML = tmp2;
}
}
Problem jest tego typu, ze gdy wpisze pierwsza liczbe 50 a druga 100 to pokazuje mi, ze pierwsza liczba jest wieksza od drugiej. Moze mi ktos wytlumaczyc o co chodzi?