goodieboy wrote:
Hi John,
Actually that was a bad example sorry! What about something like this:
$('form div.options').each(){function( i ){
$(this).children('[EMAIL PROTECTED]').each(function(){
$(this).attr('name', 'option_num_' + i);
});
});
Try this:
$('form div.options').each(){function( i ){
var j = i;
$(this).children('[EMAIL PROTECTED]').each(function(){
$(this).attr('name', 'option_num_' + j);
});
});
If that works, then try looking up Javascript closures. If not, then
I'm a little stumped.
-- Scott