$(this).attr("id", "rnd" + $(this).attr("tag") + "_" + i.toString());应该
$(this).attr("id", "rnd" + this.nodeName.toLowerCase() + "_" + i.toString());
$(this).attr("id", "rnd" + $(this).attr("tag") + "_" + i.toString());应该
$(this).attr("id", "rnd" + this.nodeName.toLowerCase() + "_" + i.toString());