On Jan 30, 2008, at 9:13 PM, Karl Swedberg wrote:
If you can assign class="port" to each of those elements, you could do this:$('.port').each(function(index) { $(this).click(function() {bigchart(index)}); }if you can't assign a class, then change $('.port') to $ ('[id^=port]') , as Josh suggested.
Oops. I missed a closing paren. should be ... $('.port').each(function(index) { $(this).click(function() {bigchart(index)}); });