I am trying to clone a div and change the names of the input fields in this div. It works great for most of the browsers but IE 7 does not change the name attribute of the i
The simple solution for Radio button is :
$("div:last").find("radio").each(function(){
var name="someNewName";
var id="someNewId";
if (!$.browser.msie || parseInt($.browser.version) > 7) {
this.name = name;
this.id=id;
}
else {
(this).attr("outerHTML", "");
}
});
This will alter the outerHTML of the element so that the HTML for the element(radio button) is overwritten. The same solution can be applied for : find("input") / find("checkbox") for the other controls too.