Bsc CSIT Semester 5 – Web Technology – Unit 4. Client Side Scripting with JavaScript
Comprehensive questions and detailed answers for Unit 4. Client Side Scripting with JavaScript. Perfect for exam preparation and concept clarity.
How can you create objects in Javascript? Create a HTML page containing a division with image and its description in paragraph. Write a javascript function to change the value of description in the paragraph during onmouseover and mouseout event on the image.
How jQuery animate can be used to create custom animation? Write syntax with sample script.
Create an HTML signup form with fields Name, Email, Password, and Age, Validate the form using JavaScript. Write functions for validating each of the elements. All of the fields should not be empty. The Email address should be a valid email, the password should be of length at least 6 and should start with the alphabet and end with a digit. The age should be between 8 and 60.
How jQuery id selector can be used to select specific element? Write an example with jQuery that will hide a paragraph on clicking a button.
Discuss about different JSON data types.
How can you create objects in Javascript? Create a HTML page containing a division with image and its description in paragraph. Write a javascript function to change the value of description in the paragraph during onmouseover and mouseout event on the image.
How jQuery animate can be used to create custom animation? Write syntax with sample script.
7 What is the use of JSON? How can you parse a JSON, illustrate with an example.
Write HTML script to create HTML form as below and perform form validation using JavaScript. The validation should be as; the username should be of length at least 4 and is required. The password should start with a character and end with # and is required. The country and gender should be checked.
What are HTML keyboard events? Write a script to display a message “Hello world” on keypress event.
How HTML elements are accessed using getElementById and getElementByTagName, illustrate using HTML script.
What is chaining in jQuery? Write a script to illustrate concept of chaining using slideUp and slideDown method.
Create an HTML file containing form elements textbox for username, password field and a checkbox for hobbies. Now write javascript function for the form validation. You should validate for username to be empty, password should be of length at least 5, and the check box should be checked.
Describe the jQuery Animate() method. Write an html script to create a div with id “mydiv”. The position of the div should be set to absolute. Now show the use of animate method to the div element to right by 300px.
Create an HTML file containing form with textbox, select and radio button. Now write a javascript function for validating the form elements. Validate textbox for required, select field should have some value selected and radio button should be checked.
What is onload event in HTML? Write an HTML script that displays alert message “Hello Nepal” in onload event.
How can you define array in javascript ? Create an array Fruit with its elements “apple”, “banana”, “mango”, “grape” and print the array.
What are jQuery selectors? Explain jQuery callback and chaining effects with appropriate jQuery scripts.
Write HTML script to demonstrate the onkeydown and onkeypress events.
Write a HTML script with proper JavaScript that will take an input from prompt box and display the input as output using the alert box.
Sample Questions
How jQuery animate can be used to create custom animation? Write syntax with sample script.
Create an HTML signup form with fields Name, Email, Password, and Age, Validate the form using JavaScript. Write functions for validating each of the elements. All of the fields should not be empty. T
How jQuery id selector can be used to select specific element? Write an example with jQuery that will hide a paragraph on clicking a button.
Discuss about different JSON data types.
And more questions available on this page.