← All examples

JavaScript Productivity booksy.com

Highlight clients with unpaid balance

Highlights Booksy Biz clients with an unpaid balance above zero so you can more easily remind them of what is due.

Code to copy

try {
  var rows = document.querySelectorAll('[data-testid*="client-row" i], [class*="client-list" i] li, [class*="customer-item" i]');
  rows.forEach(function (r) {
    try {
      var bal = r.querySelector('[class*="balance" i], [class*="debt" i], [class*="due" i]');
      if (!bal) return;
      var num = parseFloat((bal.textContent || '').replace(/[^\d.,-]/g, '').replace(',', '.'));
      if (!isNaN(num) && num > 0) {
        r.style.setProperty('background', '#fff3e0', 'important');
        r.style.setProperty('border-left', '5px solid #e65100', 'important');
      }
    } catch (e) {}
  });
} catch (e) {}

How to use this example

  1. Copy the code with the button above.
  2. Install JustZix (2 minutes) and open the extension on the target page.
  3. Add a new rule matching that page.
  4. Paste the code into the rule's JavaScript panel and save — it runs on every page visit.

Rate this example

No ratings yet — be the first.

Does this example work?

Snippets are useless without somewhere to paste them.

JustZix takes 2 minutes to install and runs your code on every matching page. No account, no payment.

Download free See use cases