<script language="javascript"> var test="this is a test"; test=test.replace(/ /ig, ""); alert(test); </script>