JS?jquery
------解决方案--------------------
var a=document.getElementByName('名字').setAttribute("id", "id名字");
------解决方案--------------------
jq的话
$("input[name=名字]").attr("id","id名字");
------解决方案--------------------
var obj = document.getElementsByName("name");
obj[0].setAttribute("id","ID");