Javascript Stop Function From Continuing Ed