Here, I'm trying to define a HTML attribute called zerg
, and display it when a paragraph is clicked, but instead, it displays "undefined" when it is clicked. What's wrong with the code that I've written, and what is the correct way to do this?
<p onclick = "alert(this.zerg);" zerg = "Why doesn't this work?">Click here!</p>