<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@page import="java.util.Map" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login page</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href="css/login.css"/>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<form action="LoginS" method="post">
<button type="submit" onclick="javascript:MyFunction();">Login</button>
<div class="container" style="background-color:#f1f1f1">
<button type="button" class="cancelbtn">Cancel</button>
<span class="psw">Forgot <a href="#">password?</a></span>
</div>
<script type="text/javascript">
MyFunction(){
alert("java Script");
}
</script>
</form>
</body>
</html>
Above is my code that I'm trying to call JavaScript function from the submit button onclick() event but its showing nothing. Am I doing any wrong in code.
When I click on the button nothing happens. I want the string value in the text box to be printed on the console.
function MyFunction(){}