Snippets / JS
JS
Transform 999999999 Into the Unlimited Sign for better UX
D
Donald McGuinn
·
135 views
·
Updated 1 year ago
This code snippet can be added to the current plan page using HTML widget. Use this number in your plan limits 999999999
document.addEventListener('DOMContentLoaded', () => {
const replaceInfinity = () => {
document.querySelectorAll('*:not(script):not(style)').forEach((element) => {
// Check if the element has no child elements and contains '999999999'
if (element.children.length === 0 && element.textContent.includes('999999999')) {
// Replace '999999999' with the infinity symbol (∞)
element.textContent = element.textContent.replace(/999999999/g, '∞');
}
});
};
// Initial check when the DOM is fully loaded
replaceInfinity();
// Observe the DOM for changes (useful for Elementor or dynamically loaded content)
const observer = new MutationObserver(() => {
replaceInfinity();
});
// Start observing the DOM for added/modified elements
observer.observe(document.body, { childList: true, subtree: true });
});
JS · 22 lines
Discussion
Ask a question or share how you used this.
Log in
to join the discussion.
No comments yet — be the first.