practice11(학점입력받아 출력).html 879 Bytes
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>practice10</title>
  </head>
  <body>
    학점:
    <input type="text" name="" value="" id="input1">
    <input type="button" name="" value="입력" onclick="call()">

    <div id = "div1">

    </div>
    <script type="text/javascript">
      function call(){


        var score = document.getElementById("input1").value;
        if(score!=""){
        var temp= document.getElementById("div1");
        if(score>= 90){
          temp.innerHTML = "<h1>your grade is A</h1> ";
        }else if(score>=80 &&score<=89){
          temp.innerHTML = "<h1>your grade is B</h1> ";
        }else if(score>=70 &&score<=79){
          temp.innerHTML = "<h1>your grade is C</h1> ";
        }else{
          temp.innerHTML = "<h1>your grade is F</h1> ";
        }



      }



      }
    </script>
  </body>
</html>