You are here: irt.org | FAQ | JavaScript | Text | Q1583 [ previous next ]
Use a regular expression:
<script language="JavaScript"><!--
var temp = new String('This is a test string... So??? What...');
document.write(temp + '<br>');
temp = temp.replace(/[^a-zA-Z 0-9]+/g,'');
document.write(temp + '<br>');
//--></script>