I\'m trying to write a function that reads a inputs value, and determines if a space has been used in it\'s creation. I\'m not trying to trim anything -- just see if it woul
Use val and indexOf :
var hasSpace = $('#myInputId').val().indexOf(' ')>=0;
If you want to test other types of "spaces" (for example a tabulation), you might use a regex :
var hasSpace = /\s/g.test($('#myInputId').val());
Demonstration
Use contains for include space:
var value = $('#myInputId').val();
if(value.contains(' ')){
console.log("has space");
}
Or you can find with these ascII code   and \xA0
if(value.contains(' ')){
console.log("has space");
}