-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGiveAway.js.js
47 lines (29 loc) · 1.03 KB
/
GiveAway.js.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
36
37
38
39
40
41
42
43
44
45
46
47
document.addEventListener("DOMContentLoaded", function () {
function getCurrentDate(){
const date = new Date();
let day = date.getDate();
let month = date.getMonth() + 1;
let year = date.getFullYear();
let currentDate = `${day}-${month}-${year}`;
const time = new Date();
let hour =time.getHours();
let minute =time.getMinutes();
let second = time.getSeconds();
let currentTime = `${hour}:${minute}:${second}`;
let dateAndTime = "Date:" + currentDate + "<br>Time: "+currentTime;
return dateAndTime;
}
setInterval(function() {
document.getElementById("time").innerHTML= getCurrentDate();
}, 1000);
window.validateEmail =function() {
const emailInput = document.getElementById("OwnerEmail");
const email = emailInput.value;
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailRegex.test(email)) {
alert("Please enter a valid email address.");
return false;
}
return true;
}
});