-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
77 lines (63 loc) · 2.37 KB
/
index.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
$(document).ready(function(){
$('.sidenav').sidenav();
$('.tooltipped').tooltip();
$('.datepicker').datepicker();
$('.timepicker').timepicker();
$('.materialboxed').materialbox();
$('.tabs').tabs();
$('.scrollspy').scrollSpy();
});
//var lis = document.getElementsByTagName('li');
//after changing into an Array you can now cycle through all off them
//console.log(Array.isArray(lis));
// console.log(Array.isArray(Array.from(lis)));
//This is how an HTML collection is cycled through
//Array.from(lis).forEach(function(item){
// console.log(item)
// });
// if it is already an array simply cycle through like this
//lis.forEach(function(item) {
//console.log(item)
// });
// to query the dom only returns on element
//const wrap = document.querySelector('.nav-wrapper li:nth-child(2).about');
// console.log(wrap);
// queryselectorAll Returns all elements with that class
//to retrieve text
//var card = document.querySelectorAll('.card-content');
// Array.from(card).forEach(function(item){
//retrieve
//console.log(item.textContent);
// to change OR Apend +="";
//item.textContent +='Welcome';
//});
// you render the entire innerHTML or any changes in he Html
// const services = document.querySelector('#Services');
// services.innerHTML += 'million';
//DOM NODES
//Declare the element you desire to querry
//const card = document.querySelector('.card');
// console.log(card.hasChildNodes());
//console.log(card.nodeName());
//console.log(card.nodeType());
//Upon declaring true returns the entire element and siblings underthat,
//But if you use false it only declares the only element
// const clonedcard = card.cloneNode(true);
// console.log(clonedcard);
//const sect = document.querySelector('#team div:nth-child(1)');
//console.log(sect.nextElementSibling);
// sect.forEach(function(item){
// console.log(item);
const form = document.querySelector('.content');
form.addEventListener('submit', (e) =>{
e.preventDefault();
form.email.value="";
form.date.value="";
form.time.value="";
});
const slid= document.querySelector('#slider');
console.log(slid);
var lis = document.getElementByTagName('li');
lis.forEach(function(item){
console.log(item);
});