Week 4: JavaScript Exercise 1 (Leon and Nimrah)

By Salomon Ruiz

Instructors: Leon and Nimrah

Link to my website: http://imanas.shanghai.nyu.edu/~srh450/js-exercise-1/index.html

JavaScript Exercise

For this exercise, first I created alerts when clicking each of the kittens pictures. For each image I wrote a different message. Then I created a button with the title “Kittens” and started adding different functions on an external JavaScript sheet, such as changing the colors of the paragraphs, the size and the content. I decided to change the title and its size when clicking this button. I also made the different sentences turn into different colors when clicking the button. Moreover, I made the second image of a cat change for another cat as well. Finally, I added a button (puppies) to open a pop up window showing the image of some puppies when clicked. I created a simple html page for this. Thanks to this exercise, now I understand better how to add DOM’s and BOM’s. However I would like to learn how to reset the original content when clicking the button again for example. Also how to style the buttons as the predetermined buttons doesn’t look very god.

 

 

 

Leave a Reply