var matchTag =/<(?:.|s)*?>/g; var text=document.getElementById(id); text.innerHTML.replace(matchTag,"");