<script>
function func()
{
var input = document.getElementById('num').value;
var output = document.getElementById('para');
var a = 60;
if(input <= 10) {
inputx = a;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 10 && input <= 20) {
inputx = a * 2;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 20 && input <= 30) {
inputx = a * 3;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 30 && input <= 40) {
inputx = a * 4;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 40 && input <= 50) {
inputx = a * 5;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 50 && input <= 60) {
inputx = a * 6;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 60 && input <= 70) {
inputx = a * 7;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 70 && input <= 80) {
inputx = a * 8;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 80 && input <= 90) {
inputx = a * 9;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
else if(input > 90 && input <= 100) {
inputx = a * 10;
output.ierHTML = "Seems like you have " + input + " POINTS, so you get: " + inputx + " EXP.
}
</script>
<input type="text" placeholder="enter the number" id="num">
<button onClick="func()">Calculate</button>
<p id="para"></p>
</body>
</html>
برچسب:
نویسنده: آیلین رضوانی