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