I have a simple button that executes a javascript function on click. The button seems to be refreshing the page, and the js code is not executing at all.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dynamic Form</title>
</head>
<body>
<div class="col-sm-12 blog-main">
<form class="form-addCards form-inline" role="form">
<div class="col-xs-2" id="submitBtn">
<button class="btn btn-primary" onclick="submit();">Submit</button>
</div>
</form>
</div>
<script src="newSet.js"></script>
</body>
</html>
And the js:
function submit(){
event.preventDefault();
alert("hit");
}