Login error in HTML code Password Invalid

we have created a simple HTML form with some fields, as user clicks submit button JavaScript code will execute.

<html>
<head>
<title>Javascript Login Form Validation</title>
<!-- Include CSS File Here -->
<link rel="stylesheet" href="css/style.css"/>
<!-- Include JS File Here -->
<script src="js/login.js"></script>
</head>
<body>
<div class="container">
<div class="main">
<h2>Javascript Login Form Validation</h2>
<form id="form_id" method="post" name="myform">
<label>User Name :</label>
<input type="text" name="username" id="username"/>
<label>Password :</label>
<input type="password" name="password" id="password"/>
<input type="button" value="Login" id="submit" onclick="validate()"/>
</form>
<span><b class="note">Note : </b>For this demo use following username and password. <br/><b class="valid">User Name : Formget<br/>Password : formget#123</b></span>
</div>
</div>
</body>
</html>

Any one help me

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Without seeing the code that handles the form, can’t really tell what the issue is. The HTML looks fine.

I need to show the Password wrong blunder on the HTML page, I can do it on various pages by utilizing request dispatcher yet how to show it on the same login page utilizing just java and HTML, I don’t know about javascript, Thank you!
HTML:

Sign into your account




${errMsg)

Servlet Code:
if(rs.next())
{
ResultSet rs1=stmt.executeQuery(vsql1);

    if(rs1.next())
    {
        out.println("----Welcome----");
    }
    else
    {
         request.setAttribute("errMsg", "Invalid username or password"); 
          RequestDispatcher dispatcher = request.getRequestDispatcher("login.html");
          dispatcher.forward( request, response);
    }
}
else
{
    request.setAttribute("errMsg", "Invalid username or password"); 
          RequestDispatcher dispatcher = request.getRequestDispatcher("login.html");
          dispatcher.forward( request, response);
}

}

Here is the solution to the above-mentioned error, I was facing the same issue while coding my https://perfectessaywriting.com/ website. So I solved this by adding the above code.