try :
var el = document.getElementsByName("10010input")[0];
var val = el.value.replace(/\s/g, "");
alert(val)
or To remove spaces <pre> if it is between
<script language="javascript">
String.prototype.ltrim = function() {
return this.replace(/^\s+/,"");
}
$(function(){
$("#idOfTextBoxHere").keyup(function(){
$(this).val( $(this).val().ltrim());
});
});
</script>