Page 231 - Web Applications (803) Class 12
P. 231
iv. for (i=1;i<1;i++)
document.write(“hello”);
document.write(“ByeBye”);
v. str=”Health is Wealth”);
document.write(str.match(“wealth”));
document.write(str.match(“Wealth”));
6. How do we get javascript on a web page explain? [CBSE HANDBOOK]
Computational Thinking
C. Competency-based/Application-based questions:
1. Consider the following code: Critical Thinking
var fruits = ["Apple", "Mangoes", "Orange", “Banana”];
Write command in JavaScript to:
Ðadd an item “Guava “ to the array fruits in the last.
r
Ðemove first element from the array.
Ðdisplay number of elements in the array.
Ðadd following array to an array “fruits”. var veg=[“Potato”, “Brinjal”, “Gourd”];
2. Declare a function ‘stringsinjava’ in JavaScript to accept two string arguments. The function should
Convert both the strings to uppercase.
Search for string1 in string2 and display the string if found.
Replace all occurrences of letter ‘A’ with ‘*’ in string1.
Display first character of string2.
LAB ACTIVITY
1. Revise entire JavaScript by watching the video – JavaScript Programming - Full Course (8 hour
duration) - https://www.youtube.com/watch?v=jS4aFq5-91M
2. Write code for OK button to find the length of the string entered in a textbox on the webpage.
3. Write a code in JavaScript to accept a number from the user and generate
a. a random number greater than the number entered.
b. next even number after the number entered. [CBSE PAPER 2020]
4. Write a function that displays a prompt box which accepts a name and displays a greeting “Happy New
Year! <name>” in a paragraph which has an id “para1”.
5. Watch the video – Starbucks Landing Page Website Design using Html CSS & JavaScript | Step
By Step Web Design Tutorial : https://www.youtube.com/watch?v=91Q6RvKvd7o and create
the same webpage.
6. Create a simple game in JavaScript! Watch the video – The Easiest JavaScript Game Ever
https://www.youtube.com/watch?v=bG2BmmYr9NQ
7. Create a Quiz by watching the video – How to create a Simple Quiz Using Html JavaScript
https://www.youtube.com/watch?v=rCVqQ8NKU2M
Web Scripting—JavaScript 229

