感觉逻辑没问题,为何不能替换标签呢?
<script type="text/javascript"> function replaceMessage(){ var newnode=document.creatElement("i"); var oldnode=document.getElementById("oldnode"); newnode.innerHTML=oldnode.innerHTML; oldnode.parentNode.replaceChild(newnode.oldnode); } </script>