<button id="alertButton">Click Me</button>
<script>
document.getElementById('alertButton').addEventListener('click', function() {
alert('Button clicked!');
});
</script>
Congratulations! You now have a basic understanding of JavaScript. You’ve learned how to declare variables, use operators, write conditional statements, loops, and functions, interact with the DOM, and handle events. JavaScript is a powerful language that allows you to create interactive web pages and dynamic user experiences.