Thanks a lot, Dave .. It works now.
I did that:
Code:
var replaceDigits = function() {

	var myid = "myid";
	document.getElementById(myid).innerHTML = 
		document.getElementById(myid).innerHTML.replace(
			/\d(?=[^<>]*(<|$))/g,
			function($0) { return map[$0] }
		);
}