Skip to content

For the Blur/zeroBlur image exercise  #21

Open
@pirooz-pakdel

Description

@pirooz-pakdel

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;
function init() {
	var image = document.getElementById("zero");
	image.onclick = showAnswer;
};

function showAnswer() {
	var image = document.getElementById("zero").setAttribute("src", "zeroblur.jpg");
	
}
</script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions