function rmWhiteSpace()
{

var str = document.getElementById('txt1').value;

str = str.replace(/\s+/g,'');

document.getElementById('txt1').value = str;

// \s+ Description
// + 1 or more of previous expression.
// \s Matches any white-space character.
// Equivalent to the Unicode character categories [\f\n\r\t\v\x85\p{Z}].
// If ECMAScript-compliant behavior is specified with the ECMAScript option,
// \s is equivalent to [ \f\n\r\t\v].
}