This code is suppose to add an onClick event to each of the a
elements, so that clicking on the element would load the content of the page dynamically into a DIV.
Now, I got this far - It will add the onClick event, but how can I load the dynamic content?
$(document.body).ready(function () {
$("li.cat-item a").each(function (i) {
this.setAttribute('onclick','alert("[load content dynamically into #preview]")');
});
});
Thank you.