Rasie1,
function divInnerHTML(){
var divtext = document.getElementById('replace1').innerHTML;
document.getElementById('replace1').innerHTML = divtext.replace(/username/g, 'USERNAME');
}
<body onload="divInnerHTML()">
<div id="replace1">username</div>
</body>