Writing js script for /tabs page