I have a piece of javascript is meant to add an onclick event to a div.
The div looks like this:
<div id="deck0" class="deck"></div>
And my javascript has:
var i = 1;
document.getElementById('deck0').SetAttribute("onclick", "begin("+i+")");
But I get this error:
Uncaught TypeError: Object #<HTMLDivElement> has no method 'SetAttribute'
Am I doing it right, or is what I am trying to achieve not possible?