document.addEventListener("DOMContentLoaded", function() {
console.log("JavaScript Loaded Successfully!");// Make sure the element is available before attempting to attach an event
var whatsappButton = document.querySelector(".whatsapp-btn a"); // Use the correct selector here
console.log("WhatsApp Button Found:", whatsappButton); // This will tell you if it's foundif (whatsappButton) {
whatsappButton.addEventListener("click", function(event) {
event.preventDefault();
console.log("WhatsApp Button Clicked");var phoneNumber = "97148818426";
var message = encodeURIComponent("Hi, I'm interested in this: " + window.location.href);
var whatsappUrl = "https://wa.me/" + phoneNumber + "?text=" + message;console.log("Opening WhatsApp with URL:", whatsappUrl);
window.open(whatsappUrl, "_blank");
});
} else {
console.log("WhatsApp Button Not Found! Check your selector.");
}
});