I want to add string (WooCommerce product tag slug) to URL but I getting this error: Uncaught TypeError: $ is not a function
I get inspired by this JSFiddle
My JS code is:
<script>
$checkboxes = $("input[type=checkbox");
$checkboxes.change(function(){
window.location.hash = "?product_tag=" + $checkboxes.filter(":checked").map(function(){
return this.value;
}).get().join(",");
console.log(window.location.hash);
});
</script>