a
This commit is contained in:
@@ -137,18 +137,22 @@ function handleFormSubmit() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function attachButtons() {
|
||||
const buttons = Array.from(document.querySelectorAll("button, a"));
|
||||
// Select all <a> or <button> elements that include "Try Now" in text
|
||||
const buttons = Array.from(document.querySelectorAll("a, button"));
|
||||
buttons.forEach(btn => {
|
||||
if (btn.textContent.trim() === "Try Now") {
|
||||
if (btn.textContent && btn.textContent.trim() === "Try Now") {
|
||||
btn.addEventListener("click", (e) => {
|
||||
e.preventDefault();
|
||||
openModal();
|
||||
e.preventDefault(); // Prevent link jump
|
||||
const modal = document.getElementById("buyNowModal");
|
||||
if (modal) modal.style.display = "flex";
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
createModal();
|
||||
handleFormSubmit();
|
||||
|
||||
Reference in New Issue
Block a user