Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. [20 pts] 111/p5/lab-week-8.html and lab-week-8.js. See the Lab Week 8 documen

ID: 3845657 • Letter: 1

Question

1. [20 pts] 111/p5/lab-week-8.html and lab-week-8.js.
See the Lab Week 8 document in Canvas for instructions. In addition, Add a button to lab-week-8.html labeled, Change List Type. When this button is clicked the list's type attribute is set to the value entered by the user in the text box. Legal values are 1, A, a, I, i. (setAttribute).

2. [20 pts] 111/p5/numberMach.html and numberMach.js. Replace the following JavaScript code in numberMach.js with jQuery code:

• window.onload()
• addEventListener()
• document.querySelector()
• document.querySelector().innerHTML • document.querySelector().value

Add a button ‘Change Image’ to the numberMachine page. Once clicked, the image on the page changes to a different image, of your choice. When clicked again, the image returns to the original image, from Project 4.

Test your numberMach.html page to make sure it works as before.

lab-week-8.html x lab-week-8.js 1 k!DOCTYPE html> html lang "en" 3 head meta charset "UTF-8" title title 6 head 7 body Remove List Item button button 16 div id outDiv'' 17 18 div 19 20 Script type text/javascript src lab-week-8. js'' Script 21 body 22 htm

Explanation / Answer

//Program to change image on button click.
//Save this code as numberMach.html file.

<html>
<head>
<script>
function changeImage()
{
var img = document.getElementById("image");
img.src="./img2.jpg";
return false;
}
</script>
</head>
<body>
<img id="image" src="./img1.jpg" />
<br><br><br>
<button id="clickme">Click to change image!</button>
</body>
</html>