diff --git a/forum.css b/forum.css new file mode 100644 index 0000000..47c9848 --- /dev/null +++ b/forum.css @@ -0,0 +1,7 @@ +body { +background-color: rgb(203, 191, 158); +} + +.userName { + color: blue; +} diff --git a/index.html b/index.html index 14c8748..eda0218 100644 --- a/index.html +++ b/index.html @@ -1,21 +1,54 @@ - Forum + Peyton Place +
+
+
+

+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+ + +
+ +
+
+ + diff --git a/main.js b/main.js index 851493a..8d7a0c0 100644 --- a/main.js +++ b/main.js @@ -1 +1,25 @@ -// your code here \ No newline at end of file + +// create a feature that would allow the user to add a new "post" +// (a message associated with a user's name) to the '.posts' div. + + +var comment = document.addEventListener('DOMContentLoaded', function () { + var submitCommentButton = document.querySelector('.btn.btn-primary'); + var commentSection = document.getElementById('commentSection'); + // when button is clicked, add comment to the list of other comments + submitCommentButton.addEventListener('click', function () { + // USe values of the new submitted name and message + var name = document.getElementById('name').value; + var message = document.getElementById('message').value; + + var newComment = `

${message} - Posted by: ${name}

`; + commentSection.innerHTML += newComment; + }); +}); + + +// submitCommentButton.addEventListener('click', function () { +// // when button is clicked, add comment to list of comemnts above +// console.log(document.getElementById('name')); + +// });