// password requirement function checkPasswordReq(pwd) { if (pwd.length < 8) { isBest = false; } else { isBest = true; } return isBest } // to get the queries of the URL function getQueryStringParams(params, url) { // first decode URL to get readable data var href = decodeURIComponent(url || window.location.href); // regular expression to get value var regEx = new RegExp('[?&]' + params + '=([^&#]*)', 'i'); var value = regEx.exec(href); // return the value if exist return value ? value[1] : null; }