File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -718,7 +718,7 @@ <h5 class="" style="font-weight: 500">
718
718
< input
719
719
class ="form-control "
720
720
type ="email "
721
- placeholder ="Your Email Here "
721
+ placeholder ="Your Email Here " required
722
722
/>
723
723
< button class ="btn "> Subscribe</ button >
724
724
</ form >
Original file line number Diff line number Diff line change @@ -54,3 +54,13 @@ function goToPage(url) {
54
54
window . location . href = url ;
55
55
}
56
56
57
+ const form = document . querySelector ( '.newsLetterForm' ) ;
58
+ const emailInput = form . querySelector ( 'input[type="email"]' ) ;
59
+
60
+ form . addEventListener ( 'submit' , ( event ) => {
61
+ event . preventDefault ( ) ;
62
+ const email = emailInput . value ;
63
+ localStorage . setItem ( 'newsletterEmail' , email ) ;
64
+ emailInput . value = '' ;
65
+ alert ( 'You are now subscribed to our newsletter!' ) ;
66
+ } ) ;
You can’t perform that action at this time.
0 commit comments