<div id="id1">Click to know</div>
<script>
function Superheroe(power){
this.power=power;
}
//edited: copy mistake solved
Superheroe.prototype.sayYourPower=function(){
alert('This is my power :'+ this.power);
}
var Mike = new Superheroe ("Code fast");
document.getElementById('id1').addEventListener("click",Mike.sayYourPower);
</script>
I'm wonder why I'm getting 'undefined' when I ask for the sayYourPower...It is for not including the "()" at the end of the method?