a) Examine the following HTML Code:

Question

<form name=”myform” onSubmit=”readMark();”>

<p> <label for=”mark”> Enter your mark: </label>

<input type=”text” size=”10″ name=”mark” id=”mark”/>

</p>

<input type=”submit” value=”Submit”/>

</form>

Write a JavaScript function readMark() to output the following classification based on the mark entered:

70+ Distinction

60 – 69 Commendation

40 – 59 Pass

0 – 39 Fail

Your JavaScript function must also do the following:

i) Check to see if the mark entered is a number or not. If it is not a number, then an appropriate error message must be outputted. ii) If the mark is outside the range of 0 to 100 then the user must be told to enter in a number between 0 and 100.

b) In regard to the JavaScript library jQuery:

i) What is the difference between jquery.js and jquery.min.js?

ii) When should a web developer use jquery.js and when should a web developer use jquery.min.js?

c) In the context of JavaScript, outline what dynamic types are and provide a suitable example.

Leave an answer

Sorry, you do not have permission to answer to this question .