diff --git a/assignments/DOM Basics/01/index.html b/assignments/DOM Basics/01/index.html index aaf6993..9d9ae2f 100644 --- a/assignments/DOM Basics/01/index.html +++ b/assignments/DOM Basics/01/index.html @@ -11,6 +11,30 @@

Document Object Model

diff --git a/assignments/DOM Basics/02/index.html b/assignments/DOM Basics/02/index.html index 818b326..fc186c9 100644 --- a/assignments/DOM Basics/02/index.html +++ b/assignments/DOM Basics/02/index.html @@ -47,6 +47,44 @@

Query Selector All

Access me by query all (2)
diff --git a/assignments/DOM Basics/03/index.html b/assignments/DOM Basics/03/index.html index d85efc7..321b18a 100644 --- a/assignments/DOM Basics/03/index.html +++ b/assignments/DOM Basics/03/index.html @@ -32,12 +32,27 @@

Types of Sharks

  • Tiger
  • Great White
  • - - - + diff --git a/assignments/DOM Basics/04/download.jpeg b/assignments/DOM Basics/04/download.jpeg new file mode 100644 index 0000000..60d6fba Binary files /dev/null and b/assignments/DOM Basics/04/download.jpeg differ diff --git a/assignments/DOM Basics/04/index.html b/assignments/DOM Basics/04/index.html index e244ce1..c55ef98 100644 --- a/assignments/DOM Basics/04/index.html +++ b/assignments/DOM Basics/04/index.html @@ -12,5 +12,27 @@

    About Me

  • Favorites:
  • Hometown:
  • + + diff --git a/assignments/events/1. Practice/index.js b/assignments/events/1. Practice/index.js index cf4d4e5..111e4d3 100755 --- a/assignments/events/1. Practice/index.js +++ b/assignments/events/1. Practice/index.js @@ -1,42 +1,63 @@ //Select the section with an id of container without using querySelector. +document.getElementById("container"); + //Select the section with an id of container using querySelector. +document.querySelector("#container"); + //Select all of the list items with a class of "second". +document.body.querySelectorAll(".second"); + //Select a list item with a class of third, but only the list item inside of the ol tag. +document.body.children[1].lastElementChild.querySelector(".third"); + //Give the section with an id of container the text "Hello!". +document.getElementById("container").textContent = "Hello"; -//Add the class main to the div with a class of footer. +//Add the class main to the div with a class of footer. + var footerClass = document.querySelector(".footer"); + footerClass.className = "main"; //Remove the class main on the div with a class of footer. +document.querySelector(".main").className = "footer"; + //Create a new li element. +var elementLi = document.createElement("li"); //Give the li the text "four". +elementLi.innerText = "four"; + //Append the li to the ul element. +document.body.querySelector('ul').appendChild(li); + //Loop over all of the list inside the ol tag and give them a background color of "green". +document.querySelectorAll("ol").forEach((cb) => {cb.style.background = "green"}); + +//Remove the div with a class of footer. -//Remove the div with a class of footer. \ No newline at end of file +document.querySelector(".footer").remove(); \ No newline at end of file diff --git a/assignments/events/2. backgroundChange/index.html b/assignments/events/2. backgroundChange/index.html index de6b110..306a98c 100755 --- a/assignments/events/2. backgroundChange/index.html +++ b/assignments/events/2. backgroundChange/index.html @@ -8,6 +8,7 @@ +

    Hello World

    \ No newline at end of file diff --git a/assignments/events/2. backgroundChange/main.css b/assignments/events/2. backgroundChange/main.css index e69de29..6561d16 100755 --- a/assignments/events/2. backgroundChange/main.css +++ b/assignments/events/2. backgroundChange/main.css @@ -0,0 +1,3 @@ +body{ + background-color: white; +} \ No newline at end of file diff --git a/assignments/events/2. backgroundChange/main.js b/assignments/events/2. backgroundChange/main.js index e69de29..2563cda 100755 --- a/assignments/events/2. backgroundChange/main.js +++ b/assignments/events/2. backgroundChange/main.js @@ -0,0 +1,12 @@ +function changeBackground(){ + document.body.style.backgroundColor = "hotpink" +}; + +document.body.addEventListener("mousemove", changeBackground); + +function random() { + var col = `#${String(9597547352642325273375 * Math.random()).slice(0, 6)}`; + document.body.style.backgroundColor = col; +} + +document.body.addEventListener("mousemove", random); \ No newline at end of file diff --git a/assignments/events/3. randomQuotes/index.html b/assignments/events/3. randomQuotes/index.html index 3b854bd..21b7a37 100755 --- a/assignments/events/3. randomQuotes/index.html +++ b/assignments/events/3. randomQuotes/index.html @@ -8,6 +8,12 @@ +

    Click For Random Quotes

    +
    +

    +

    +
    + \ No newline at end of file diff --git a/assignments/events/3. randomQuotes/main.js b/assignments/events/3. randomQuotes/main.js index 8686458..9c7a745 100755 --- a/assignments/events/3. randomQuotes/main.js +++ b/assignments/events/3. randomQuotes/main.js @@ -3,7 +3,6 @@ var quotes; // Write your code here - quotes = [ { "quoteAuthor": "Thomas Edison", @@ -314,3 +313,11 @@ quotes = [ "quoteText": "Great talent finds happiness in execution." } ]; + +function newQuote () { + + var randomQuote = Math.floor((Math.random() * quotes.length)); + document.getElementById("quotedisplay").innerHTML = quotes[randomQuote].quoteText; + document.getElementById("quoteauthor").innerHTML = quotes[randomQuote].quoteAuthor; +} +document.getElementById("clicked").addEventListener("click", newQuote); diff --git a/assignments/events/4. mouseMove/index.html b/assignments/events/4. mouseMove/index.html index e69de29..e686709 100644 --- a/assignments/events/4. mouseMove/index.html +++ b/assignments/events/4. mouseMove/index.html @@ -0,0 +1,33 @@ + + + + + + Mouse-Over + + + + +

    MouseOver Event

    +

    +

    +

    +

    + +