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
<!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>Article Test</title> | |
</head> | |
<body> | |
<section class="section"> |
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
let val; // initilizing alpha variable | |
const list = document.querySelector('ul.showcase'); // assigning sub variable "list" to the ul in the html collection | |
val = list.childNodes; // HERE THE METHOD "childNodes" IS ASSIGNED TO THE "list" VARIABLE TO GET IT'S CHILD NODES | |
console.log(val); // calling the alpha variable |
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
let val; // initilizing alpha variable | |
const list = document.querySelector('ul.showcase'); // assigning sub variable "list" to the ul in the html collection | |
val = list.children; // HERE THE METHOD "children" IS ASSIGNED TO THE "list" VARIABLE TO GET IT'S CHILDREN | |
console.log(val); // calling the alpha variable |
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
let val; // initilizing alpha variable | |
const list = document.querySelector('ul.showcase'); // assigning sub variable "list" to the ul in the html collection | |
val = list.children[1]; // HERE THE SPECIFIC METHOD SELECTION "children[1]" SELECTS THE SECOND CHILD OF THE PARENT ELEMENT | |
val.textContent = 'Ensure To Follow'; // here we manipulate the selected child and change it's text content |
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
let val; // initilizing alpha variable | |
const list = document.querySelector('ul.showcase'); // assigning sub variable "list" to the ul in the html collection | |
val = list.children[1].children[0]; // HERE WE ARE SELECTING THE FIRST CHILD OF THE SECOND CHILD IN THE "list" AND ASSIGNING IT TO "val" | |
val.style.color = 'red'; // here we manipulate and change "val"'s color |
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
const li = document.createElement('li'); // this creates an "li" element | |
li.className = 'New-photo'; // this assigns a class to the "li" element | |
li.setAttribute('title', 'The new kid in town'); // this assigns an attribute to the "li" element | |
li.appendChild(document.createTextNode('The new list Item')); // this inputs a text node into the newly created "li" element | |
document.querySelector('ul.showcase').appendChild(li); // THIS WOULD APPEND THIS INTO THE EXISTING ELEMENTS IN THE INTERFACE |
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
const newHeading = document.createElement('h1'); // this creates a new element which in this case a "h1" element | |
newHeading.appendChild(document.createTextNode('Taking over this space!!')); // assigning a text node to the newly created element | |
const oldHeading = document.querySelector('li.photo'); // initializing the element to be replaced to a variable | |
const ulElement = document.querySelector('ul.showcase'); // initializing the parent element | |
ulElement.replaceChild(newHeading, oldHeading); // THIS REPLACES THE OLD ELEMENT WITH THE NEW ONE |
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
const liElements = document.querySelectorAll('li'); // initializing a variable to represent all the "li" elements in the provided Html collection | |
liElements[1].remove(); // THIS TARGTES AND SELECTS THE "li" ELEMEMT IN THE SECOND INDEX IN THE "liElements" AND REMOVES IT |
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
const liElements = document.querySelectorAll('li'); // this initializes "liElements" as a variable to represent all the "li" elements in the Html collection | |
const list = document.querySelector('ul'); // this initializes "list" as a variable to represent the "ul" element in the Html collection | |
list.removeChild(liElements[3]); // THIS EXECUTES THE MAIN TASK BY TAKING OUT THE 4TH "li" ELEMENT IN THE "ul" USING THE ".removeChild()" METHOD |
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
<!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"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css" integrity="sha512-EZLkOqwILORob+p0BXZc+Vm3RgJBOe1Iq/0fiI7r/wJgzOFZMlsqTa29UEl6v6U6gsV4uIpsNZoV32YZqrCRCQ==" crossorigin="anonymous" referrerpolicy="no-referrer" /> | |
<title>Form Interface For Events Test</title> |
OlderNewer