javascript – getElementById – setAttribute()

Od posmura

 

Změna ID

document.getElementById("původní_ID").setAttribute("id","nové_ID");

Změna NAME

document.getElementById("nějaké_ID").setAttribute("name","nový_název");