You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For anyone interested: This code based on previous lessons from this excellent book will also work for this Event Handler exercise. It uses the setAttribute( x, y) method instead of the image.src object/property/value pathway.
function init() {
var image = document.getElementById("zero");
image.onclick = showAnswer;
};
function showAnswer() {
var image = document.getElementById("zero").setAttribute("src", "zeroblur.jpg");
}
</script>
The text was updated successfully, but these errors were encountered:
For anyone interested: This code based on previous lessons from this excellent book will also work for this Event Handler exercise. It uses the setAttribute( x, y) method instead of the image.src object/property/value pathway.
<!doctype html>
<title> Image Guess </title> <style> body { margin: 20px; } img { margin: 20px; } </style> <script> window.onload = init;The text was updated successfully, but these errors were encountered: