how to make a login button with jquery ?
i have a simple index.php file which has a form with a button. When the user clicks the button , jquery script login.js runs and alert the user. for some reason when i click the button nothing happens.
from
- index.php:
- <!DOCTYPE html>
- <html>
- <head>
- <title> Log in </title>
- <script src = "jquery-3.1.1.js"></script>
- <script src = "login.js"></script>
- <body>
- <div style="width:200px;margin:auto;">
- <h1> Log in Example </h1>
- <p> Please log in to you raccount</p>
-
- <p>
- <strong> Username </strong>
- </p>
-
- <p>
- <input type ="username" placeholder = "Username" >
- </p>
-
-
- <p>
- <strong> Password</strong>
-
-
- </p>
-
- <p>
-
- <input type = "password">
-
- </p>
-
- <button id = "login_btn" > Log In </button>
-
- </div>
-
- </body>
- </html>
login.js :
- $(document).ready(function(){
- $(#login_btn").click(function(){
- alert("logging in");
-
-
- });
- });