Click Event - Exercise
How do I make an click event - exercise?
What is a click event - exercise? How do you make a click event - exercise? This script and codes were developed by Matthew Nahmias on 27 December 2022, Tuesday.
Click Event - Exercise - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Click Event - Exercise</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="wrapper"> <h1 class="title">Click Event Exercise</h1> <p><a id="hello" class="btn-hello" href="#">I'm a button!</a></p>
</div> <script src="js/index.js"></script>
</body>
</html>
Click Event - Exercise - Script Codes CSS Codes
body{ font-size:16px; background: #000; font-family: Franklin Gothic Medium, Franklin Gothic, ITC Franklin Gothic, Arial, sans-serif;
}
.wrapper{ width: 100%; text-align:center;
}
.title{ font-weight:300; color:#fff;
}
.btn-hello{ background-color:#A87D9B; font-size: 24px; border-radius: 1.5rem; padding: .75rem 1.5rem; color: #fff; text-decoration: none; display: inline-block;
}
Click Event - Exercise - Script Codes JS Codes
// Create a function that alerts the user with a greeting when it runs
function sayHi(){ alert('Hello World!');
}
// Store the button element in a variable
var helloButton = document.getElementById('hello');
// Add a click event listener to the button element that runs the alert function
helloButton.onclick = sayHi;
Developer | Matthew Nahmias |
Username | mnahmias |
Uploaded | December 27, 2022 |
Rating | 3 |
Size | 1,953 Kb |
Views | 8,096 |
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 |
Madlib Game - Solution | 2,258 Kb |
Madlib Game - Exercise | 2,068 Kb |
Array Manipulation Example | 2,007 Kb |
Hover Cards | 4,545 Kb |
Click Event - Solution | 1,956 Kb |
A Pen by Matthew Nahmias | 4,649 Kb |
Light Switch - Solution | 2,333 Kb |
Bus Animation | 5,854 Kb |
Light Switch - Exercise | 2,365 Kb |
Space Pen | 5,202 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 |
JQuery AJAX reddit Exercise | Btholt | 1,777 Kb |
AOR site logo | Thatbram | 2,527 Kb |
TweetBox with React JS | J0zelito | 3,325 Kb |
Single element checkbox | Ivijaygupta | 1,996 Kb |
Welcome | Nakome | 6,076 Kb |
About Us | Francescaedits | 1,902 Kb |
IPhone5S SVG Space Grey | Onlinechris | 75,035 Kb |
Sequence.js - Sliding Horizontal Parallax | Maheshc | 4,537 Kb |
Incremental game | Eprouver | 5,868 Kb |
Animated rainbow wave on canvas | Icodeforlove | 2,777 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!