-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
54 lines (43 loc) · 1.51 KB
/
script.js
File metadata and controls
54 lines (43 loc) · 1.51 KB
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
48
49
50
51
52
53
54
function validate() {
var usnm = document.getElementById("username").value;
var pass = document.getElementById("pwd").value;
// var correctpwd = /[?.*\d][?.*[a-z]][?.*[A-Z]].{6,}/;
var correctpwd = /^[A-Za-z]\w{7,14}$/;
// var correctpwd = "abhi";
if (pass.match(correctpwd)) {
console.log("correct");
location.replace("second.html")
check();
}
}
function check() {
var usnm = document.getElementById("username").value;
console.log(usnm);
var mytime = new Date
alert("hii " + usnm + "Loged in at" + mytime);
// CreateRGB();
// location.replace("second.html")
pickRandomColor();
}
function getColorCode() {
var makeColorCode = '0123456789ABCDEF';
var code = '#';
for (var count = 0; count < 6; count++) {
code = code + makeColorCode[Math.floor(Math.random() * 16)];
}
return code;
}
//Function call on button click.
function pickRandomColor() {
var p = document.querySelector("#demo");
document.body.style.backgroundColor = getColorCode();
}
// function CreateRGB() {
// var p = document.querySelector("#demo");
// p.innerHTML = +
// Math.floor(Math.random() * 255) + +
// Math.floor(Math.random() * 255) + +
// Math.floor(Math.random() * 255) ;
// document.body.style.backgroundColor = p.innerHTML;
// document.body.style.transition = "all 0.3s ease"
// }