Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function convert_string(str) {
str = str.replace(/0/g, " ");
str = str.replace(/1/g, " ");
str = str.replace(/2/g, " ");
str = str.replace(/3/g, " ");
str = str.replace(/4/g, " ");
str = str.replace(/5/g, " ");
str = str.replace(/6/g, " ");
str = str.replace(/7/g, " ");
str = str.replace(/8/g, " ");
str = str.replace(/9/g, " ");
return str;
}
function convert() {
var class1 = document.getElementById("div1").innerText;
var class2 = document.getElementById("div1");
class2.innerText = convert_string('' + class1 + '');
}
</script>
</head>
<body>
<button onclick="convert()">click</button>
<hr>
<div>Result:</div>
<hr>
<div id="div1">Hello2016world!</div>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 508