Not working after score=3

i just used jquery replaceWith but its seems not working after score=3. the fiddle shows what is going on. please click in this order like button1, button3, button2 then the score increase by point 1 for each button but after score=3 i.e., after clicking all three buttons the score stops and does not respond. i even tried with other button ids but its not working.below is the replace id that i assigned and as the text of the button changes but not responding to score and click.

$("#three").click(function () {
$("#three").replaceWith("<button id=\\"three\\" type=\\"button\\" data-index=\\"0\\" >cat</button>");

});

It looks like replacing the buttons has as a side effect that the jquery click function is no longer bound to them, even if you give them the same id as the old buttons. I added an alert in your fiddle code, and once the buttons #one and #three have been replaced, the click function isn’t called anymore. Only the #two button keeps calling it, and that button isn’t replaced.

Can you please explain what you are expecting to happen when you click the buttons? How do you want the scoring to work? What is the purpose of the game?