var elements=document.getElemensByTagName('tagname') for(var i=0;i<elements.length;i++)elements[i].innerHTML.replace(/>/,'&rt;')