diff --git a/about.html b/about.html new file mode 100644 index 0000000..6800e85 --- /dev/null +++ b/about.html @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html3.html b/html3.html new file mode 100644 index 0000000..01535c2 --- /dev/null +++ b/html3.html @@ -0,0 +1,36 @@ + + + + + + + + + + Table of Content + + + + + +
+
+

Table of Contents

+
+
+
+

Fruits

+

Red Fruits

+

Apple

+

Raspberry

+

Orange Fruits

+

Orange

+

Tangerine

+

Vegetables

+

Vegetables Which Are Actually Fruits

+

Tomato

+

Eggplant

+
+ + + \ No newline at end of file diff --git a/javaScript.js b/javaScript.js new file mode 100644 index 0000000..60f0fb0 --- /dev/null +++ b/javaScript.js @@ -0,0 +1,37 @@ + +document.getElementById("para1").innerHTML = "We are coders"; +document.getElementById("para2").innerHTML = "We are coders"; +document.getElementById("para1").innerHTML = "Developers for life!"; + + + +var img = document.createElement('img'); +img.src = "lib/images/Kimberly Bryant.jpg"; +var src = document.querySelector("body"); + src.appendChild(img); + + + document.getElementById("para1").style.color = "blue"; + document.getElementById("para1").style.fontSize = "40px"; + + var button = document.createElement('button'); +button.innerHTML = 'click me'; +src.appendChild(button); + + button.addEventListener('click', () => { + if(img.style.display == 'none'){ + img.style.display = 'block'; + + }else { + + img.style.display = 'none'; + } + }); + + + + + + + + diff --git a/javaScript3.js b/javaScript3.js new file mode 100644 index 0000000..bc20bb0 --- /dev/null +++ b/javaScript3.js @@ -0,0 +1,49 @@ +var c = function() { + return({ + log: function(msg) { + consoleDiv = document.getElementById('console'); + para = document.createElement('p'); + text = document.createTextNode(msg); + para.appendChild(text); + consoleDiv.appendChild(para); + } + }); +}(); + +window.onload = function () { + var toc = ""; + var level = 0; + var maxLevel = 3; + + document.getElementById("contents").innerHTML = + document.getElementById("contents").innerHTML.replace( + /([^<]+)<\/h([\d])>/gi, + function (str, openLevel, titleText, closeLevel) { + if (openLevel != closeLevel) { + c.log(openLevel) + return str + ' - ' + openLevel; + } + + if (openLevel > level) { + toc += (new Array(openLevel - level + 1)).join("
    "); + } else if (openLevel < level) { + toc += (new Array(level - openLevel + 1)).join("
"); + } + + level = parseInt(openLevel); + + var anchor = titleText.replace(/ /g, "_"); + toc += "
  • " + titleText + + "
  • "; + + return "" + + titleText + ""; + } + ); + + if (level) { + toc += (new Array(level + 1)).join(""); + } + + document.getElementById("toc").innerHTML += toc; +}; \ No newline at end of file diff --git a/js-dom.html b/js-dom.html new file mode 100644 index 0000000..f8a3929 --- /dev/null +++ b/js-dom.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + +

    +

    + + + + + \ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 0000000..32ceb5a --- /dev/null +++ b/main.js @@ -0,0 +1,13 @@ +body.style.fontFamily = 'Arial, sans-serif'; + +var li = document.querySelectorAll('li'); +for (let i=0 ; i < li.length; i +=1){ + li[i].style.color = 'red'; +} + +var img = document.createElement('img'); +img.src = "nkenna.jpg"; +body.appendChild(img); +img.style.width = '30%'; + +var name = document.querySelector('li').innerHTML = "Nickname: UgoJr."; \ No newline at end of file diff --git a/nkenna.jpg b/nkenna.jpg new file mode 100644 index 0000000..9402396 Binary files /dev/null and b/nkenna.jpg differ diff --git a/script2.js b/script2.js new file mode 100644 index 0000000..0a7088c --- /dev/null +++ b/script2.js @@ -0,0 +1,17 @@ +var head = document.querySelector('head'); +var title = head.innerHTML = "About me "; +var body = document.querySelector('body'); +var ul = document.createElement('ul'); +body.appendChild(ul); + +ul.innerHTML = "
  • Nickname: booboo
  • Favorites: music, pizza, The Office
  • Hometown: Wilmington
  • Random Fact: Black is my favorite color.
  • "; + + + + +// ""; \ No newline at end of file