document.getElementById('test').innerHTML.replace(/<.+?>/gim,'')用innerHTML来代替innerText要达到的效果。innerText只是符合IE。