Apply javascript