changing alerts and connecting buttons to js