You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script>
// Function to increment the like count
var likeCount = 0;
function incrementLikes() {
likeCount++;
var likeElement = document.querySelector('.like');
likeElement.textContent = 'Like ' + likeCount;
}
// Function to add a comment
function addComment() {
var commentInput = document.getElementById('comment-input');
var comment = commentInput.value;
var commentElement = document.createElement('div');
commentElement.classList.add('comment-bubble');
commentElement.textContent = comment;
var buttonContainer = document.querySelector('.button-container');
buttonContainer.parentNode.insertBefore(commentElement, buttonContainer);
commentInput.value = '';
}
// Event listener for Enter key press
var commentInput = document.getElementById('comment-input');
commentInput.addEventListener('keydown', function(event) {
if (event.key === 'Enter') {
event.preventDefault(); // Prevent form submission
addComment();
}
});