I was looking to implement the helpful answer here but it isn't working for me in my browser or even in the code snippet here but works in jsfiddle http://jsfiddle.net/joydh7L0/2/
Basically the alert is always shown and the script doesn't seem to be working. Am a beginner so might be missing something very obvious. Any help appreciated!
Update: Based on a couple of comments on this I am using bootstrap and with that using their recommended jQuery link. Thanks!
"https://code.jquery.com/jquery-3.4.1.slim.min.js"
<!doctype html>
<html lang="en">
<head>
</head>
<body>
<button type="submit" class="btn btn-primary">Submit</button>
<div class="alert alert-success" id="submitsuccess" role="alert"> Thanks for letting us know!</div>
<script>
$(document).ready(function() {
$(".alert").hide()
$("button").click(function showAlert() {
$(".alert").fadeTo(2000, 500).slideUp(500, function() {
$(".alert").slideUp(500);
})
})
})
</script>
</body>