-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
37 lines (29 loc) · 934 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
document.addEventListener("DOMContentLoaded", function() {
//Carousel
const flkty = new Flickity( '.main-carousel', {
cellAlign: 'left',
});
//Email Validation
const subscribe = document.getElementById("subscribe-form");
const inputText = document.getElementById("email");
subscribe.addEventListener("submit", function (event) {
event.preventDefault();
let inputVal = inputText.value;
if (inputVal === "") {
alert('Please entered an valid email address!');
} else {
alert('Thank you for your subscribe!');
}
});
// Cartt
const cartTotal = 0;
$("$counter").hide();
$(".button").on("click", function(event) {
event.preventDefault();
cartTotal++;
$("$counter")
.text(cartTotal)
.show();
console.log(".counter");
});
});//end of document ready