-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
executable file
·70 lines (49 loc) · 1.61 KB
/
script.js
File metadata and controls
executable file
·70 lines (49 loc) · 1.61 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
var b1 = document.getElementsByClassName('button-main1')[0]
var div1 = document.getElementsByClassName('main1-c')[0]
// document.getElementsByClassName('main1-c')[0].style.backgroundColor='green'
// function toggleColor()
// {
// var currentColor = div1.style.backgroundColor;
// if (currentColor === "white" || currentColor === "") {
// div1.style.backgroundColor = "black";
// b1.style.backgroundColor='black'
// div1.style.color='white'
// b1.style.color='white' // Change to the desired color
// } else {
// div1.style.backgroundColor = "white";
// b1.style.backgroundColor='white'
// div1.style.color='black'
// div.style.color='black'
// }
// }
function toggleColor(button) {
var div = button.parentNode;
// div.classList.toggle('highlight');
if (div.classList.contains('highlight')) {
div.classList.remove('highlight');
button.style.backgroundColor='black'
button.style.color='white'
} else {
div.classList.add('highlight');
button.classList.add('highlight')
button.style.backgroundColor='white'
button.style.color='black'
}
}
var name1,email,message;
function formClick()
{
name1 = document.getElementById('name1')
email = document.getElementById('email1')
message = document.getElementById('message')
var data = {
'name':name1.value,
'email':email.value,
'message': message.value
}
localStorage.setItem('data',JSON.stringify(data))
name1.value='';
email.value='',
message.value='';
}
console.log(name1,email,message)