Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>


<script src="script2.js" async defer></script>
<script src="main.js" async defer></script>
</body>
</html>
36 changes: 36 additions & 0 deletions html3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Table of Content</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<div id="console"></div>
<div id="toc">
<h3>Table of Contents</h3>
</div>
<hr/>
<div id="contents">
<h1>Fruits</h1>
<h2>Red Fruits</h2>
<h3>Apple</h3>
<h3>Raspberry</h3>
<h2>Orange Fruits</h2>
<h3>Orange</h3>
<h3>Tangerine</h3>
<h1>Vegetables</h1>
<h2>Vegetables Which Are Actually Fruits</h2>
<h3>Tomato</h3>
<h3>Eggplant</h3>
</div>
<script src="javaScript3.js" async defer></script>
</body>
</html>
37 changes: 37 additions & 0 deletions javaScript.js
Original file line number Diff line number Diff line change
@@ -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';
}
});








49 changes: 49 additions & 0 deletions javaScript3.js
Original file line number Diff line number Diff line change
@@ -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])>([^<]+)<\/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("<ol>");
} else if (openLevel < level) {
toc += (new Array(level - openLevel + 1)).join("</ol>");
}

level = parseInt(openLevel);

var anchor = titleText.replace(/ /g, "_");
toc += "<li><a href=\"#" + anchor + "\">" + titleText
+ "</a></li>";

return "<h" + openLevel + "><a name=\"" + anchor + "\">"
+ titleText + "</a></h" + closeLevel + ">";
}
);

if (level) {
toc += (new Array(level + 1)).join("</ol>");
}

document.getElementById("toc").innerHTML += toc;
};
26 changes: 26 additions & 0 deletions js-dom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>


<p id="para1"></p>
<p id="para2"></p>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<script src="javaScript.js" async defer></script>
</body>
</html>
13 changes: 13 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -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.";
Binary file added nkenna.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions script2.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var head = document.querySelector('head');
var title = head.innerHTML = "<title>About me </title>";
var body = document.querySelector('body');
var ul = document.createElement('ul');
body.appendChild(ul);

ul.innerHTML = "<span id = 'span1'><li>Nickname: booboo</li></span > <span id= 'span2'><li>Favorites: music, pizza, The Office</li></span><span id= 'span3'><li>Hometown: Wilmington </li> </span><span id = 'span4'><li>Random Fact: Black is my favorite color.</li></span>";




// "<ul>
// <li>Nickname: booboo</li>
// <li>Favorites: music, pizza, The Office</li>
// <li>Hometown: Wilmington </li>
// <li>Random Fact: Black is my favorite color.</li>
// </ul>";