javascript for card rendering after each guess