Display result on page instead of in JS alert