<!DOCTYPE html>
<html>
<head>
<style>
.image {
height: 100px;
width: 100px;
image-rendering: auto;
}
</style>
</head>
<body>
<h1>Change image-rendering with JavaScript</h1>
<p>Click the "Try it" button to change the image-rendering from auto to pixelated:</p>
<img id="myIMG" class="image" src="smiley.gif" alt="Smiley" width="32" height="32">
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("myIMG").style.imageRendering = "pixelated";
}
</script>
</body>
</html>