Alert user if the password field contains spaces at start or end of the string with javascript
<p>I have a password field, and if password contains any spaces at start or end, I would like to alert the user. password can be a phrase so spaces in between the string is allowed. </p>

<p>I am sure it can be done through regex, but I don't have much hands on it.</p>

<p>If some one can please help me out.</p>
