I try to add event listener function, but for some reason it fails. See example:
<!DOCTYPE html>
<html>
<head>
<script>
function loaded(){
document.getElementById("first").addEventListener("click", showPopup());
}
function showPopup(){
alert('hello');
}
</script>
</head>
<body onload="loaded()">
<div id="first">
click me !!!
</div>
</body>
</html>
Clicking on the "click me!!!" text do nothing, furthermore showPopup() function fires once.
I deeply apologize for this trivial question, but I am spending too much time to see the mistake.
Thanx a lot