I'm trying to dismiss this snackbar when I click the add to cart <a href>
but it doesn't output anything. Anyone can help me? here is my code
SNACKBAR CODE
<div id="snackbar">Some text some message..</div>
A HREF CODE
<a class="btn btn-primary" href="?add=<?php echo($i); ?>" onClick="myFunction()">Add to cart
JQUERY.JS CODE
function myFunction() {
var x = document.getElementById("snackbar")
x.className = "show";
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
}