Week 4- Javascript Exercise 1 (Leon & Nimrah) – Jo

My link: http://imanas.shanghai.nyu.edu/~ej807/js-exercise-1/index.html

First off, I had a pretty difficult time starting this assignment because I honestly did not know where to begin. To be clear, I did not understand which information would be put into the html section and which would be put into the javascript tab. At this point, I did not clearly even understand the distinction between class and id either to be honest and I had trouble taking in all the information from lecture too. So, I met up with Leon and it definitely helped a lot but it was still a little hard to grasp and I forgot the things I was told by Sunday. Therefore, I made another appointment with Jiwon for today(Tuesday). Finally, I understood what was going on and I wondered why I had struggled initially.
My first step was to figure out which event to wait for. I decided to change the header background as well as the text content with an onclick button. I proceeded to create a new function and wrote the instructions inside of that function and gave that function name as value of the event. I changed the background color to blue as well as the text to “AH. CUTENESS OVERLOAD. I CRI.” I did the same event for changing the image and created a new function as well. I changed the first image to the fourth image. My final step was to create a pop-up window on the click of the button. I used the button tag to create the event followed by the script tag with the function inside. I created an additional html file titled bom.html and calling it with window.open in order for this file to open when the button was clicked. Lastly, I added the width and height. Below are screenshots of the steps I took to complete this homework.

Leave a Reply