JSFiddle - React, Tailwind, and code Playground
by BilisimOgretmeni
HTML
<!DOCTYPE html>
<html>
<head>
<title>www.bilisimogretmeni.com</title>
<script>
function kontrol()
{
var y=document.getElementById("hata");
y.innerHTML="";
try
{
var x=document.getElementById("sayi").value;
if(x=="") throw "Boş";
if(isNaN(x)) throw "Sayı Değil";
if(x>10) throw "Büyük sayı";
if(x<5) throw "Küçük Sayı";
}
catch(err)
{
y.innerHTML="Hata: " + err + ".";
}
}
</script
</head>
<body>
<p>5-10 arasında bir sayı girin</p>
<input id="sayi" type="text">
<button type="button" onclick="kontrol()">Sayıyı Kontrol Et</button>
<p id="hata"></p>
</body>
</html>