Click Me, Name Me

Developer
Size
2,113 Kb
Views
46,552

How do I make an click me, name me?

What is a click me, name me? How do you make a click me, name me? This script and codes were developed by Yang Li on 13 July 2022, Wednesday.

Click Me, Name Me Previews

Click Me, Name Me - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Click Me, Name Me</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id='container'> <p id='p1'>I'm Batman, Click Me</p> <img src="http://ow.ly/r8sK305ZO06"/> <img src="http://ow.ly/fU3w305ZO17"/> <p id='p2'>Rename Me</p>
</div> <script src="js/index.js"></script>
</body>
</html>

Click Me, Name Me - Script Codes CSS Codes

#container { width: 620px; display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center;
}
p, img{ width: 300px; height: 300px; border: 1px solid grey; text-align: center; line-height: 300px; cursor: pointer;
}

Click Me, Name Me - Script Codes JS Codes

// Declaring DOM objects at the top
para1 = document.getElementById('p1');
para2 = document.getElementById('p2');
batman = para1.nextElementSibling;
superman = para2.previousElementSibling;
// Click to change to light grey background
para1.onclick = function() { if (para1.style.backgroundColor != 'gainsboro') { para1.style.backgroundColor = 'gainsboro'; } else { para1.style.backgroundColor = 'white'; }
}
// Rename "Rename Me" to "Superman"
para2.onclick = function() { if (para2.innerHTML != 'Clark Kent') { para2.innerHTML = 'Clark Kent'; } else { para2.innerHTML = 'Superman'; }
}
// Change background image of super and batman
batman.onclick = function() { batman.style.backgroundImage = "url('http://tse1.mm.bing.net/th?id=OIP.M622808f4357997743e129c9b572471cdo0&pid=15.1')";
}
superman.onclick = function() { superman.style.backgroundImage = "url('http://www.smartskyways.com/Market/stations/future-city.jpg')";
}
Click Me, Name Me - Script Codes
Click Me, Name Me - Script Codes
Home Page Home
Developer Yang Li
Username aussieyang
Uploaded July 13, 2022
Rating 3
Size 2,113 Kb
Views 46,552
Do you need developer help for Click Me, Name Me?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Yang Li (aussieyang) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!