QUESTION 2 Figure 3 shows an HTML markup for a Checking Student Status Form in which the user can enter credit hours for
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
QUESTION 2 Figure 3 shows an HTML markup for a Checking Student Status Form in which the user can enter credit hours for
QUESTION 2 Figure 3 shows an HTML markup for a Checking Student Status Form in which the user can enter credit hours for the current semester and a message will be displayed indicating whether the status is Full-time or Part-time. <div id="chckStatus"> </div> <h1>Checking Student Status</h1> <form id="formChkStatus"> <label for="crHrs">Enter your credit hours: </label> <input type="text" id="crHrs" /> <div id="feedback"></div> <input type="submit" value="Check" /> </form> Figure 3 a) Create a JavaScript function called checkCreditHours () that will display a message whether the student is full-time or part-time. If the value received less than 8 and greater than 24, display "Please enter a valid credit hour" at <div> with id="feedback". If the value less and equal to 12, pass the message "Status: Part time student." or else "Status: Full time student." . Use the following declaration: var elForm = document.getElementById("formChkStatus"); var elMsg = document.getElementById("feedback"); var elCrHrs = document.getElementById("crHrs"); (5 marks) b) Write an event listener that will trigger function checkCreditHours when button submit is clicked.