JS for auto-highlight