Use if statement to check the value range
<html> <head> <title></title> </head> <body> <script type="text/javascript"> var temp = prompt("number value:"); if (temp > 100) { document.write("100"); } else if (temp < 20) { document.write("20"); } </script> </body> </html>