skip to Main Content

Animation with InnerHTML

document.getElementById("first-img").addEventListener("click", function(){ document.getElementById("detail-img").innerHTML = `Detail of first img` }) document.getElementById("second-img").addEventListener("click", function(){ document.getElementById("detail-img").innerHTML = `Detail of second img` }) .container{ display: flex; height: 30px; gap: 1rem; } .img{ background-color: red; } <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,…

VIEW QUESTION
Back To Top
Search