How do i add onclick to a Div via JS?
<p>I have a piece of JS which is meant to add an onclick event to a div like this:</p>

<pre><code>&lt;div id="deck0" class="deck"&gt;&lt;/div&gt;
</code></pre>

<p>And my JS line has:</p>

<pre><code>var i = 1;
document.getElementById('deck0').SetAttribute("onclick", "begin("+i+")");   
</code></pre>

<p>But i get this error:</p>

<pre><code>Uncaught TypeError: Object #&lt;HTMLDivElement&gt; has no method 'SetAttribute' 
</code></pre>

<p>Am i doing it right, or is it not possible with what I am trying to achieve??</p>
