xxxxxxxxxx
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>JavaScript rotate images</title>
</head>
<body>
<img id="img" src="https://via.placeholder.com/350x150.png" />
<button onClick="rotateImg()">Rotate Image</button>
<script>
function rotateImg() {
document.querySelector("#img").style.transform = "rotate(90deg)";
}
</script>
</body>
</html>