Create jQuery Selector in For loop


I’m new to javascript and am trying to create a For loop to create iterated selector class names so that i can target specific divs. Here is the code im trying to implement:

		$(document).ready(function() {
			$( ".tabRow" ).hide();
			for ( var i = 0; i < <?php echo $this->_data['productCount']; ?>; i++ ) {
				var productRowInt = '.productRow' + i;
				var tabRowInt = '.tabRow' + i;
				$(productRowInt).click(function() {

I can see in Firebug that the var’s have been setup but nothing is happening. How should i insert a selector from a javascript var?


Your code seems fine at first glance.
Could you post a link to a page where I can see this not working?