QB - Css PR Exam 2024 p16-1
QB - Css PR Exam 2024 p16-1
21
Develop a form with several input fields. Write JavaScript code that changes the border color of an input field to green when it
gains focus and to red when it loses focus (blur).
22
Write a JavaScript function that listens for the keydown event on an input box. When a key is pressed, log the key's value to the
console.
23
Develop an input box that counts the number of characters entered. Write JavaScript code that listens for the input event and
updates a paragraph with the character count in real-time.
24 Write a JS to implement keyevents on an inputbox
25
Write a JS Program to create a window with mouse events. Implement mouse events like on click, on double click, on mouse
down, on mouse up, on mouse move.
Write a JS Program to create a textbox and 2 drop-down menus. The 2 drop-down menu's will have options of different font-
26 styles and font-sizes respectively. The font-style and font-size of the text inside the textbox should change dynamically on change
of either of the drop-down menu selections.
27 Create a form, collect user input and submit the form when user presses enter key on the last element of the form.
28
Create a web page with a set of radio buttons that allow users to select a category of options (e.g., Fruits, Vegetables, or Grains).
Depending on the selected category, dynamically generate corresponding checkbox options.
Design a simple survey form using HTML and JavaScript that includes two radio buttons ("Yes" and "No"), a checkbox for
29 "Subscribe to newsletter," and a "Submit" button. Upon clicking the "Submit" button, display a thank you message in a read-only
textarea based on the user's selections.
30
Create a JavaScript program that changes the text of a label based on the value of an input field as the user types. The label
should update in real-time to reflect the current input. Use an image instead of button to implement intrensic function.
Write a JS Program to create a student registration form. Accept the following details: StudentName, StudentAge,
31 StudentPhoneNumber. Use a drop-down menu to allow the user to select their year. Dynamically change the item of the next
drop-down menu to allow the user to choose the semester. Use an image instead of button to implement intrensic function.
32 Write a JS Program to implement all concepts of cookies, namely: Create, Read and Delete.
33
Write a JS Program to implement window functions like: resizeBy, resizeTo, scrollBy, scrollTo, moveBy, moveTo, open a
window on the same tab, open the window on a new tab and open a window on a new page.
Write a javscript that displays a form that contains an input for username & password. User is prompted to enter the input &
34 password & password becomes the value of the cookie. Write a JavaScript function for storing the cookie. It gets executed when
the password changes.
35
Write a JavaScript program that creates a cookie called lastVisit which stores the current date and time. The cookie should expire
in 14 days. Also, demonstrate how to read this cookie value and display it on the web page.
Write a JavaScript function that opens a new browser window with a specific URL(any URL available), width, and height on a
36 Button Click. The function should also set the window's position on the screen. Ensure that window is brought on focus when it
is opened.
Create a function that opens three new browser windows with different URLs: one for a search engine (e.g., Google), one for a
37 social media site (e.g., Facebook), and one for a news site (e.g., BBC). Use setTimeout to focus each window in sequence with a
delay of 3 seconds between each focus action.
38 Write a JavaScript function to check whether a given address is a valid IP address or not.
39
Create a script that sets a cookie with a specific expiration date (e.g., 30 days from now) and displays a message indicating when
the cookie will expire.
40 Write a script that opens a new window and with a heading, a paragraph.close the window using button.
41
Create a JavaScript application with two buttons: the first opens a window displaying the current date in DD/MM/YYYY format,
and the second opens another window displaying all prime numbers between 1 and 50.
42
43 Write a javascript to create option list containing list of images and then display images in new window as per selection.
44
Write a JS program that validates a strong password. The password must be at least 8 characters long, contain at least one
uppercase letter, one lowercase letter, one digit, and one special character.
Write a JS program that validates a phone number based on the following criteria: it must be 10 digits long and may start with 7,
45 8, or 9.