JavaScript Assignment No. 05 (DOM manipulation)

In this fourth JavaScript assignment, I focused on understanding and applying functions. Through various tasks, I explored function declarations, expressions, parameters, return values, and scope. This assignment strengthened my problem-solving skills and deepened my grasp of how functions streamline JavaScript code.

Task 1. Change the text of the paragraph with id "message" to "Welcome!".

Hello!

Task 2. Get the value from "nameInput" and display it in the "result" div.

Value: 00

Task 3. On button click, set the background color of "container" to light blue.

Task 4. Change the color of the "mainTitle" heading (h1) to red.

Task 5. Get the number from "num1" and display it in the "output" paragraph.

Value: 00

Task 6. Log "Button Clicked" when a button with class "submit-btn" is clicked.

Task 7. Add the values from "first" and "second" inputs and display the sum in the "sum" span.

Sum: 00

Task 8. Update the text of the paragraph with class "description" to "Updated successfully".

Task 9. Set the width of the "box" div to 200px and background color to green.

Task 10. Log the email entered in the "email" input.

Email:

Task 11. Change the font size of a selected paragraph to 24px.

Change My Color and Font Size

Task 12. On button click, set "Hello, [name]" in the "greeting" div using the "fullName" input.

Task 13. Change the "profilePic" image's src to another URL.

profilePic