after several tries (especially this question) I still can't get the text that the user enters in my inputs :
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="css1.css">
<link type="text/css" rel="stylesheet" href="login.css">
<script src="js/jquery-2.1.1.min.js"></script>
</head>
<body>
<div id="firstForm">
<h2>Login</h2>
<form id="signin" action="index.html" method='post'>
<input id='login1' class="inputs" name="mail" type="email" placeholder="mail" required>
<input id='password1' class="inputs" name="password" type="password" placeholder="password" required><br>
<input class="inputs" type="submit" id="submitLogin">
</form>
</div>
</body>
<script src='js/loginscript.js'></script>
</html>
JS :
(function (){
var login=document.getElementById("login1").value;
var pwd=document.getElementById("password1").value;
console.log(login + ' * '+ pwd);
document.getElementById('signin').addEventListener('submit',function(e){
console.log(login + ' * '+ pwd);
e.preventDefault();
},false);
})();
Both console logs print out the * with blanks : nothing was caught...
Thank you!