JavaScript Tutorial

Set the ID of element

e.g. $("#elementid div:firstchild").attr("id", "my_new_id");