tags:

views:

31

answers:

1

I need to know how i can change the name of a element. I have the id of that element say it is "tester" Ok the on page load problem could be solved this way.

 $(document).ready(function() {

 });

but how can i change the name of a element like this?

<div id="tester" name="fun">
</div>

what i want as result

<div id="tester" name="tester">
</div>
+8  A: 

Using .attr:

$("#tester").attr("name","tester");
marcgg