javascript alert now works on button click