-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a064c8
commit c13abc3
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Day 13</title> | ||
</head> | ||
|
||
<body> | ||
<h1 id="task-heading">My list</h1> | ||
<ul class="collection"> | ||
<li class="collection-item">Hello</li> | ||
<li class="collection-item">Greetings</li> | ||
<li class="collection-item">Hi</li> | ||
<li class="collection-item">Welcome</li> | ||
<li class="collection-item">JS</li> | ||
</ul> | ||
<button onclick=colourChange()>Click</button> | ||
<script src="appday13.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Day 14</title> | ||
</head> | ||
|
||
<body> | ||
<div class="heading"> | ||
<h1 id="task-heading">My list</h1> | ||
<ul class="collection"> | ||
<li class="collection-item">Hello</li> | ||
<li class="collection-item">Greetings</li> | ||
<!-- THIS IS A COMMENT--> | ||
<li class="collection-item">Hi</li> | ||
<li class="collection-item">Welcome</li> | ||
<li class="collection-item">JS</li> | ||
</ul> | ||
</div> | ||
<button>Click</button> | ||
<script src="appday14.js"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var elementById = document.getElementById('task-heading'); | ||
// elementById.innerHTML = 'MY LIST'; | ||
var querySel = document.querySelector('ul.collection'); | ||
var tag = document.getElementsByTagName('li'); | ||
var lis = Array.from(tag); | ||
lis.forEach(function (li) { | ||
li.textContent = 'Jery'; | ||
}) | ||
var querysela = document.querySelectorAll(".collection-item"); | ||
|
||
function colourChange() { | ||
var abc = document.getElementsByClassName('collection-item'); | ||
console.log(ab); | ||
|
||
} | ||
var lise = querySel.children; | ||
|
||
console.log(lise); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const list = document.querySelector('ul.collection'); | ||
const listitem = document.querySelector('li.collection-item'); | ||
var val = list.childNodes[0]; | ||
val = list.firstElementChild; | ||
val = list.lastElementChild; | ||
val = listitem.parentElement.parentElement; | ||
val = list.childElementCount; | ||
val = listitem.nextElementSibling; | ||
// console.log(val); | ||
// console.log(list); | ||
// console.log(listitem); | ||
// creating an element | ||
const li = document.createElement('li'); | ||
li.className = 'collection-item'; | ||
const textelement = document.createTextNode('One more element'); | ||
li.append(textelement); | ||
document.querySelector('ul.collection').appendChild(li); | ||
// | ||
|
||
// const link = document.createElement('a'); | ||
// link.innerHTML = "<h1>here</h1>"; | ||
// li.appendChild(link); | ||
|
||
// | ||
const newHeading = document.createElement('h5'); | ||
newHeading.append(document.createTextNode("Tasks")); | ||
const oldHeading = document.getElementById('task-heading'); | ||
const div = document.querySelector('.heading'); | ||
div.replaceChild(newHeading, oldHeading); | ||
|
||
console.log(oldHeading); | ||
|