Friday, December 21, 2012

click

never use function with name click(), it is a keyword.

The issue is that click is a property on <button> DOM elements, but not on <a> DOM elements. Rename your method and it should work just fine.

Ex: 

Poor Programming


<div onclick="click(this)" id="red">red</div>
<div onclick="click(this)" id="blue">blue</div>
<div onclick="click(this)" id="green">green</div>
<div onclick="click(this)" id="yellow">yellow</div>

No comments: