window.onload = function() {
// Your existing script here
stars.forEach(star => {
star.addEventListener('click', function(e) {
console.log(`Star clicked: ${this.getAttribute('data-value')}`);
// Rest of your code...
});
});
document.addEventListener('DOMContentLoaded', function() {
const stars = document.querySelectorAll('.star');
const feedbackMessageContainer = document.getElementById('feedback-message');
stars.forEach(star => {
star.addEventListener('click', function(e) {
const rating = parseInt(this.getAttribute('data-value'), 10);
if (rating === 5) {
// Open review platform - Replace URL with your review page
window.open('https://www.detailsnashville.com/review-links', '_blank');
} else {
// Display message with a link to the feedback form for ratings 4 or lower
// Replace the href value with your actual feedback form URL
feedbackMessageContainer.innerHTML = 'We appreciate your feedback! Please click here to tell us how we did!';
}
});
});
});
};