Click Me, Name Me
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 - 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')";
}
Developer | Yang Li |
Username | aussieyang |
Uploaded | July 13, 2022 |
Rating | 3 |
Size | 2,113 Kb |
Views | 46,552 |
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!
Name | Size |
Progress Bar | 2,261 Kb |
Recreate Google Starter | 1,409 Kb |
Battleships Starter | 2,429 Kb |
Recreate Google | 1,853 Kb |
Geography Quiz | 2,136 Kb |
Responding Boxes Starter | 1,779 Kb |
Highlight Me Starter | 1,628 Kb |
Animated Clock Starter | 1,571 Kb |
My Friends Starter | 1,573 Kb |
Goalkeeper | 2,373 Kb |
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!
Name | Username | Size |
Google Fonts Sass Mixin | HugoGiraudel | 4,237 Kb |
Kudos Please | TimPietrusky | 6,624 Kb |
A Pen by Shidhin | Shidhincr | 5,015 Kb |
Myprofile | SoufianeAbid | 2,451 Kb |
Countdown Timer | Massiebn | 3,001 Kb |
My Starter Kit For Codepen | Dkdesign | 2,012 Kb |
Highbrow Basic HTML Lesson 7 | Kimlarocca | 1,662 Kb |
Another brick in the wall | Fivera | 1,955 Kb |
Portfolio Landing Page | FDfranklin | 3,585 Kb |
Reading Grid | Tappily | 4,306 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!