Forum Replies Created

Viewing 1 replies (of 1 total)
  • You can use this JavaScript code to remove the decimals .00

    <script>
    document.addEventListener("DOMContentLoaded", function () {

    const iframe = document.querySelector("#give-form-shortcode-1");
    if (!iframe) return;

    iframe.addEventListener("load", function () {

    const doc = iframe.contentDocument || iframe.contentWindow.document;

    const removeDecimals = () => {
    const buttons = doc.querySelectorAll(".givewp-fields-amount__level");

    buttons.forEach(btn => {
    const txt = btn.textContent;
    if (txt.includes(".00")) {
    btn.textContent = txt.replace(".00", "");
    }
    });
    };

    const target = doc.querySelector(".givewp-fields-amount__levels-container");

    if (target) {
    removeDecimals();

    const observer = new MutationObserver(removeDecimals);

    observer.observe(target, {
    childList: true,
    subtree: true
    });
    }

    });

    });
    </script>
Viewing 1 replies (of 1 total)