0% found this document useful (0 votes)
6 views

JavaScript Questions

Modern tech

Uploaded by

sadiomane8706
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

JavaScript Questions

Modern tech

Uploaded by

sadiomane8706
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1. Write a program to print "Hello, world!" to the console.

2. Write a program to find the sum of two numbers.


3. Write a program to calculate the factorial of a number.
4. Write a program to check if a number is even or odd.
5. Write a program to check if a number is prime.
6. Write a program to find the largest element in an array.
7. Write a program to reverse a string.
8. Write a program to check if a string is a palindrome.
9. Write a program to count the number of vowels in a string.
10. Write a program to convert Celsius to Fahrenheit.
11. Write a program to find the length of the longest word in a sentence.
12. Write a program to remove duplicates from an array.
13. Write a program to find the sum of all numbers in an array.
14. Write a program to check if a given year is a leap year.
15. Write a program to check if a string contains a specific substring.
16. Write a program to find the Fibonacci series up to a given number of terms.
17. Write a program to sort an array of numbers in ascending order.
18. Write a program to check if a number is a palindrome.
19. Write a program to find the square root of a number.
20. Write a program to find the factorial of a number using recursion.
21. Write a program to reverse the order of words in a sentence.
22. Write a program to remove all white spaces from a string.
23. Write a program to check if a string is an anagram.
24. Write a program to find the second largest element in an array.
25. Write a program to find the maximum and minimum elements in an array.
26. Write a program to check if a number is a perfect square.
27. Write a program to check if a number is a Armstrong number.
28. Write a program to find the average of numbers in an array.
29. Write a program to find the GCD (Greatest Common Divisor) of two numbers.
30. Write a program to find the power of a number.
31. Write a program to convert a decimal number to binary.
32. Write a program to check if a number is a strong number.
33. Write a program to find the area of a triangle.
34. Write a program to convert a string to lowercase.
35. Write a program to check if a string is a valid email address.
36. Write a program to count the number of occurrences of a specific element in an array.
37. Write a program to check if a number is a perfect number.
38. Write a program to find the LCM (Least Common Multiple) of two numbers.
39. Write a program to find the reverse of a number.
40. Write a program to check if a string is a pangram.

 Write a program to change the text color of a paragraph using JavaScript when a button is
clicked.
 Write a program to toggle the visibility of a div element using JavaScript and a button.
 Write a program to validate a form using JavaScript before submitting it.
 Write a program to create a simple image slideshow using JavaScript and CSS animations.
 Write a program to show/hide an element based on a checkbox's checked state using
JavaScript and CSS.
 Write a program to dynamically update the background color of a webpage based on user
input using JavaScript.
 Write a program to create a responsive navigation menu using HTML, CSS, and JavaScript.
 Write a program to create a form that dynamically adds input fields when a button is clicked
using JavaScript.
 Write a program to display a countdown timer on a webpage using JavaScript and CSS.

1.  Write a program to create a simple image gallery with thumbnail navigation using
JavaScript and CSS
2. Write a program to change the background color of a webpage when a button is clicked
using JavaScript and CSS.
3. Write a program to create a dropdown menu using HTML, CSS, and JavaScript.
4. Write a program to create a form that dynamically displays error messages for invalid
input using JavaScript and CSS.
5. Write a program to create a responsive image gallery with lightbox functionality using
JavaScript, HTML, and CSS.
6. Write a program to create a slideshow with automatic image rotation using JavaScript
and CSS.
7. Write a program to validate a password input field and display strength indicators using
JavaScript and CSS.
8. Write a program to create a responsive pricing table using HTML, CSS, and JavaScript.
9. Write a program to create a sticky navigation bar that stays at the top of the page on scroll
using JavaScript and CSS.
10. Write a program to create a tooltip for elements on a webpage using JavaScript and CSS.
11. Write a program to create a progress bar that updates based on user input using
JavaScript and CSS.
12. Write a program to create a form that dynamically updates the options of a select
dropdown based on another dropdown's selection using JavaScript and CSS.
13. Write a program to create a collapsible accordion menu using HTML, CSS, and
JavaScript.
14. Write a program to create a responsive card layout using HTML, CSS, and JavaScript.
15. Write a program to create a responsive navigation bar that collapses into a hamburger
menu on smaller screens using HTML, CSS, and JavaScript.
16. Write a program to create a form with real-time validation using JavaScript and CSS.
17. Write a program to create a tabbed content section using HTML, CSS, and JavaScript.
18. Write a program to create a responsive image carousel using JavaScript and CSS.
19. Write a program to create a form that submits data to a server and displays a success
message using JavaScript, HTML, and CSS.
20. Write a program to create a scrolling animation when the user clicks on an anchor link
using JavaScript and CSS.
21. Write a program to create a responsive grid layout using HTML, CSS, and JavaScript.
22. Write a program to create a modal window that opens when a button is clicked using
JavaScript, HTML, and CSS.
23. Write a program to create a dynamic table that allows sorting and filtering of data using
JavaScript and CSS.
24. Write a program to create a form with autocomplete functionality using JavaScript,
HTML, and CSS.
25. Write a program to create a responsive timeline using HTML, CSS, and JavaScript.
26. Write a program to create a form that validates email addresses using JavaScript and
CSS.
27. Write a program to create a draggable element on a webpage using JavaScript and CSS.
28. Write a program to create a responsive video player using JavaScript, HTML, and CSS.
29. Write a program to create a form that calculates and displays the total price based on
selected options using JavaScript, HTML, and CSS.
30. Write a program to create a responsive footer layout using HTML, CSS, and JavaScript.
31. Write a program to create a multi-step form with progress indicators using JavaScript,
HTML, and CSS.

You might also like