-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforum.html
More file actions
60 lines (50 loc) · 2 KB
/
forum.html
File metadata and controls
60 lines (50 loc) · 2 KB
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
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Forum</title>
<link rel="stylesheet" href="forum.css">
</head>
<body>
<header>
<h1>Forum</h1>
</header>
<main>
<div class="left-column">
<div class="post-container">
<h2>SEQUENCE OF PROCEDURE</h2>
<h6>by:example on x/x/202x</h6>
<p>If a wounded man comes to me,with two bullets in his body,do I call the police before operating </p>
</div>
<div class="comments-container" id="commentsContainer">
<!-- Comments will be dynamically added here -->
</div>
<textarea id="commentContent" placeholder="Write your comment..."></textarea>
<button onclick="submitComment()">Submit Comment</button>
</div>
<div class="right-column">
<!-- Add content here for the right column -->
<h2>LOOKING FOR SOMETHING?</h2>
<p>this part of the website is currently under development</p>
</div>
</main>
<script>
function submitComment() {
const commentContent = document.getElementById('commentContent').value;
// Simulating a backend API call to add a comment
addComment(commentContent);
// Clear the textarea after submitting the comment
document.getElementById('commentContent').value = '';
}
function addComment(content) {
// Simulating a backend storage mechanism
const commentsContainer = document.getElementById('commentsContainer');
const commentDiv = document.createElement('div');
commentDiv.className = 'comment';
commentDiv.innerHTML = `<p>User: ${content}</p>`;
commentsContainer.appendChild(commentDiv);
}
</script>
</body>
</html>