How to implement unobtrusive javascript with dynamic content generation?
<p>I write a lot of dynamically generated content ( developing under PHP ) and I use jQuery to add extra flexibility and functionality to my projects.</p>

<p>Thing is that it's rather hard to add JavaScript in an unobtrusive manner. Here's an example:</p>

<p>You have to generate a random number of DIV elements each with different functionality triggered onClick. I can use the "onclick" attribute on my DIV elements to call a JS function with a parameter but that is just a bad solution. Also I could generate some jQuery code along with each div in my PHP "for" loop, but then again this won't be entirely unobtrusive.</p>

<p>So what's the solution in situations like this?</p>
