Change The ID of A Form Element Using Jquery
Here we consider how to change an element's ID using Jquery.
Lets start with one example here.
Suppose we have a button and a link inside form as shown below.

On Button click, we needs to change the ID of the link.
In Jquery, on button click, we will find the link using its ID.
Then change link's ID using jQuery attr as shown below.
$(function () {
$('#btnChange').click(function(){
$('#linkID').attr("id", "newId");
})
})
That's all, by this way we can change the id of an element using jQuery attr.