On Apr 30, 2007, at 12:38 PM, Lambari wrote:


Hello,

I'm trying to change a element's name and id. I've managed to change
the ID but it seems that jQuery can't change the name.

here is my code:
$("#custom_"+i).attr("id", "custom_"+cnt ); // working
$("#custom_title_"+i).attr("name", "custom_title_"+cnt ); // not
working
$("#custom_content_"+i).attr("name", "custom_content_"+cnt ); // not
working

is there another way to change an element's name?


cheers,
bigo


Are you getting a JavaScript error?

Also, are you selecting on the id when you should be selecting on the name?

You might want to try something like this to make sure that you're actually selecting something:

$('[EMAIL PROTECTED]' + i + ']').attr("name", "custom_title_"+cnt );



--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com


Reply via email to