Possible Duplicate:
How do I trim a string in JavaScript?
So....
" steve monkey "
would become "steve monkey"
and...
" cheese charlie face "
would become "chesse charlie face"
so basically take out all space characters that occur before the first non-space character, and also remove all space characters after the last non-space character, but don't remove any spaces in between. thanks!!!
right now i am just removing all spaces like below, but i learned we need to keep spaces in the middle... :(
$newPassword.val().split(" ").join("")