-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
58 lines (54 loc) · 1.59 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./styles.css" />
<title>Better Threads</title>
</head>
<body>
<div id="nav">
<h1>Better Threads</h1>
<img
class="logo"
src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/01/Threads_%28app%29.svg/1024px-Threads_%28app%29.svg.png"
/>
<a href="/">Feed</a>
</div>
<ul id="posts">
<li>
<a href="/post1">
Michigan Hackers is the best club on campus!! Also join V1 it's pretty
cool.
</a>
<img
class="thumbnail"
src="https://michhackers.com/leadership/category-team-leads.jpg"
/>
</li>
<li>
<a href="/post2.html"> Free fragels on the diag. </a>
<img
class="thumbnail"
src="https://www.mlive.com/resizer/WAu0ADxWWaDuhbYjZ4JNn6gy228=/1280x0/smart/arc-anglerfish-arc2-prod-advancelocal.s3.amazonaws.com/public/V4LBRQTSEVBAXIV2AXTM5OKQRA.JPG"
/>
</li>
</ul>
<form onSubmit="
addPost()
return false;
"
>
<input type="text" id="input" value="hello"/>
<button>New Post</button>
</form>
<script type="text/javascript">
function addPost() {
var text = document.getElementById('input').value
var item = `<li><a>${text}</a></li>`
document.getElementById('posts').innerHTML += item
document.getElementById('input').value = ""
}
</script>
</body>
</html>