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
27 changes: 27 additions & 0 deletions TableContents3.html
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 name="viewport" content="width=device-width, initial-scale=1.0">
<title>Table of Contents</title>
</head>
<body>
<div >
<h3>Table of Contents</h3>
</div>
<hr/>
<div >
<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>
</body>
</html>
67 changes: 67 additions & 0 deletions TableContentsDOM.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Table of Contents</title>

<!-- <script> -->
<!-- function myFunction() { -->
<!-- document.getElementById("tableofcontents").innerHTML = "Table of Contents."; -->
<!-- } -->
<!-- </script> -->
</head>

<body>
<!-- <div > -->
<h1>Table of Contents</h1>
<!-- </div> -->
<!-- <hr/> -->
<!-- <div > -->
<!-- <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> -->

<ul id="Red Fruits">
<h2>Red Fruits</h2>
<li>Apple</li>
<li>Raspberry</li>
<ul id="Orange Fruits">
<h2>Orange Fruits</h2>
<li>Orange</li>
<li>Tangerine</li>
<ul id="Vegetables">
<h1>Vegetables</h1>
<p>Vegetables Which Are Actually Fruits</p>
<li>Tomato</li>
<!-- <li>Eggplant></li> -->
</ul>
<br>
<p>Click the button to append an item to the end of the list.</p>
<br>
<button onclick="myFunction()">Try it</button>

<script>
function myFunction() {
var node = document.createElement("LI");
var textnode = document.createTextNode("Eggplant");

node.appendChild(textnode);
document.getElementById("Red Fruits").appendChild(node);
}
</script>



</body>
</html>
36 changes: 36 additions & 0 deletions about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>About me</title>
</head>
<h1>About me</h1>
<body>

<img src="image/myself.jpg.jpg" alt ="My Photo" width="250" height="250">

<ul class ="about-me">
<li>Nickname: <span id="nickname"></span>coopcool</li>
<li>Favorites: <span id="favorites"></span>House music, Italian food, Seinfeld</li>
<li>Hometown: <span id="hometown"></span>Brooklyn, New York</li>
<li>Random Fact: <span id="random-fact"></span>I like new sports cars.</li>
</ul>

<button type="button" onclick="myFunction(li)">Set font</button>

<script>
function myFunction() {
document.getElementById("nickname").style.fontFamily = "Arial,sans-serif";
document.getElementById("favorites").style.fontFamily = "Arial,sans-serif";
document.getElementById("hometown").style.fontFamily = "Arial,sans-serif";
document.getElementById("random-fact").style.fontFamily = "Arial,sans-serif";
}
</script>


</body>
<script src="main.js"></script>

</html>
Binary file added image/myself.jpg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions js-dom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Document</title>
</head>
<body>
<p id="myP">We are coders</h2>
<p id="myP2">Developers for life!</p>

<br>

<button type="button" onclick="myFunction()">Set text color</button>

<script>
function myFunction() {
document.getElementById("myP").style.color = "blue";
document.getElementById("myP2").style.color = "orange";

}
</script>


</body>

</html>

-
8 changes: 8 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

function myFunction() {
document.getElementById("nickname").style.fontFamily=Arial;
document.getElementById("favorites").style.fontFamily;
document.getElementById("hometown").style.fontFamily;
document.getElementById("random-fact").style.fontFamily;
}