ASSIGNMENT 3 (Unit 4) : Web Programming (3160713) Hardik Patel
ASSIGNMENT 3 (Unit 4) : Web Programming (3160713) Hardik Patel
01
101
0101
10101
6. Create HTML Page with JavaScript which takes Integer number as input and tells whether the
number is Prime or Not.
7. What do you mean by event in JavaScript? Give at least two examples of events with their
handling.
8. Explain DOM structure of HTML. Write JavaScript code to know which mouse button was clicked
and number of elements in form.
9. Design a login form using HTML & JavaScript with following validations using Regular
Expression on username and password fields.
(ii) The script should give message that "vowel is pressed" if vowel keys are pressed.
(iii) Background color should change to red after releasing the pressed key.
12. Design a login form with username and password option using HTML and JavaScript. Perform
following validations.
(i) Username field: minimum length 6 characters, it should not have any special character or digits
other than _
(ii) Password field: minimum length 8 characters and maximum length 12 characters, it must at
least one digit and at least one special character from the set {*,#,_}
(i) If the mouse is over heading, change font color to “red” and if the mouse goes out of the heading
change it to “black”
(ii) If key pressed is ‘a’,’e’,’i’,’o’,’u’, the message should be displayed on pop up box that “vowel
is pressed”
(iii)If “Date and Time” button is clicked it displays current date and time information
14. Explain the Document Object Model. Explain any two document object with example.
15. Write a javascript to accept a number to check whether it is greater than 100 or not?