Untitled
unknown
plain_text
a month ago
824 B
7
Indexable
// Scroll to Section function scrollToSection(sectionId) { document.getElementById(sectionId).scrollIntoView({ behavior: "smooth" }); } // Add to Cart Functionality function addToCart(productName) { alert(productName + " added to cart! 🛒"); } // Submit Review function submitReview() { let reviewText = document.getElementById("review-text").value; let rating = document.getElementById("star-rating").value; if (reviewText.trim() === "") { alert("Please enter your review before submitting!"); return; } let reviewEntry = document.createElement("p"); reviewEntry.textContent = `⭐ ${rating} - "${reviewText}"`; document.getElementById("review-list").appendChild(reviewEntry); document.getElementById("review-text").value = ""; }
Editor is loading...
Leave a Comment