How to attach class onClick event using JavaScript?
<p>I have a full AJAX page with elements that act like buttons (with events like <code>onclick="$('#workcont').load('pages/mypage.html #m3-to-12');"</code>). The elements being referenced are <code>&lt;li&gt;</code> and <code>&lt;tr&gt;</code> (in a table). </p>

<p>How do I attach event handlers to add the class <code>selected</code> on click?</p>
