Free Puzzle Questions with Answer using Java, C#, JavaScript and PHP

JavaScript - If Else Statement

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <script language="JavaScript" type="text/javascript">
        function GradeManager(){
            var mark = document.getElementById('txtMark').value;

            if(mark >= 90){
                alert("The grade is A");
            }
            else if(mark >= 80){
                alert("The grade is B");
            }
            else{
                alert("The grade is C");
            }
        }
    </script>
</head>
<body>
    <input type="text" id="txtMark" />

    <button onclick="GradeManager()"> Manage Grade </button>
</body>
</html>