So I've been trying to figure this out for hours
Here is the error I'm getting:

I don't understand what is causing the error, any insight would be appreciated!
And here is my code, disregard the smarty syntax:
<html>
<head>
<title>{$title}</title>
{include file='header/header.tpl'}
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container" style="padding-top: 5%;">
<form action="" method="POST">
<center>
<img src="" style="height: 70px;">
</center>
<div class="form-signin">
<input type="email" class="form-control" style="font-size: 10pt;" id="email" placeholder="Email Address" required autofocus>
<input type="password" class="form-control" style="font-size: 10pt;" id="password" placeholder="Password" required>
<input type="submit" class="btn btn-warning btn-sm" value="Login" data-loading-text"Login" id="login" onClick="login();" style="outline: none;">
</div>
</form>
</div>
{literal}
<script type="text/javascript">
$(function() {
function login() {
alert('asdf');
}
});
</script>
{/literal}
</body>
</html>
loginis not in scope. Add the event in JavaScript not in the markup.loginfunction and the input withid="login"can be references withlogin, so you're ending up with a name-collision here.$('#login').click(login)or add a "submit" event to the form