-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.js
More file actions
45 lines (33 loc) · 1.23 KB
/
Copy pathmap.js
File metadata and controls
45 lines (33 loc) · 1.23 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
function validateForm() {
let x= document.forms ["myForm"] ["name","email","message"].value;
if (x=="") {alert ("Please fill out the forms");
return false;
}
}
function viewMore() {
document.getElementById("view2").style.display="none";
document.getElementById("view3").style.display="block";
document.getElementById("view1").style.display="block";
}
function viewLess() {
document.getElementById("view2").style.display="block";
document.getElementById("view3").style.display="none";
document.getElementById("view1").style.display="none";
}
function search() {
//DOM Manipulation
const input = document.getElementById('filter').value.toUpperCase();
const cardContainer = document.getElementById('card-list');
console.log(cardContainer);
const cards = cardContainer.getElementsByClassName('card');
console.log('cards');
for(let i=0; i < cards.length; i++) {
let title = cards[i].querySelector(".card-body h4.card-title");
console.log('title');
if(title.innerText.toUpperCase().indexOf(input) > -1) {
cards[i].style.display = "block";
} else {
cards[i].style.display = "none";
}
}
}