Make buttons appear and disappear based on actions in JS