Can't seem to get jQuery validate pluging to work with Typescript.
This works:
$(document).ready(function() {
alert('hi')
})
This gives a compilation error: ' Property 'validate' does not exist on type 'JQuery'.'
$(document).ready(function() {
$("#form").validate();
})
Tried installing: npm install --save @types/jquery.validation
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="icon" href="/favicon.png" type="image/x-icon">
<link rel="stylesheet" href="/styles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
<title>Document</title>
</head>
<body>
<section class="section">
<div class="wrapper"></div>
<form class="form__box" id="form">
<label>Username</label>
<input type="text" name="username">
<label>E-mail</label>
<input name="email" type="text">
<label>Password</label>
<input name="password" type="text">
<button>SUBMIT</button>
</form>
</section>
<script src="/scripts.js">
</script>
</body>
</html>
$(document).ready(function() {
$("#form").validate();
})