I have created two folders with name
1)JSP containing jsp file(for login)
2)JS containing javascript file(for login validation)

I have linked javascript file with jsp file int he following way.
<script type="text/javascript" src="../JS/loginValidate.js">

How can I access parameters of login page(jsp file in JSP folder) in javascript file?

in your button submit

<input type="button" onclick="validator_function_from_js()" value="submit"/>

then in your javascript have this function

function validator_function_from_js(){
    var username = document.getElementById('usernameidhere').value;
    var password = document.getElementById('passwordidhere').value;
    //then the rest of the code....
}