Creation of elements not working

Creation of elements not working


Hi. I'm having some issues on jquery, specifically with safari. I
need to create dynamic links for paging, so I use this code inside a
for statement
for (var i = 0; i < totalPages; i++)
if (i != currPage - 1)
$('<a></a>').attr('href', 'javascript:void(0)')
.attr('onclick', 'showPage(' + (i + 1) + ')')
.html(i + 1)
.appendTo('#resultspaging');
else
$('<span></span>').addClass('page').html(i + 1).appendTo
('#resultspaging');
This shows ok on Firefox. In safari, the "onclick" attributes are not
rendered, so my links are totally inactive. It works if I set the JS
function to the 'href' attribute, but there is another place where I
neet to set a 'onclick' attribute to a 'tr' element, that doesn't has
'href' attribute.
http://portal.anacafe.org/CoffeeSearchSystem/