Click here to Skip to main content
14,266,476 members
Rate this:
Please Sign up or sign in to vote.
See more:
It's about arranging the jumbled letters in correct order to make a spelling. The question is in the middle div and the letters are around it. Clicking the letter moves it to the answer div one by one to make the spelling. It's working fine, but on restarting the quiz, the score div is not displaying the score. Could you please help to figure out the error?

https://codepen.io/Tarun1980/pen/byQorp[^]

What I have tried:

// Restarting Quiz

    $(document).on('click', '#summary a', restart);
    function restart()
    {
        i = 0;
        k = 0;
        n = 0;
        score = 0;

        $('#summary').fadeOut();
        $('#questionDiv').fadeIn();
        $('#answerDiv').empty();
        $('#answerDiv').fadeIn();
        $('#score').fadeIn();
        $('#btn').fadeIn();
        showQuestions();
        hello();
        world();
        createDivs();
    }
});
Posted
Updated 30-May-19 20:16pm
v2
Comments
Gerry Schmitz 31-May-19 2:50am
   
You mean it's not showing a nought; or it's showing but a nought? Or no nought at all?
#realJSOP 31-May-19 7:21am
   
Wought?
ZurdoDev 31-May-19 8:40am
   
You didn't post enough of the code and html for us to be able to help. You need to debug this to find out what is happening.
Tarun Rathore 31-May-19 9:41am
   
The score is not updating after restarting the game as it is doing in the first round.
I have posted the online link.
Kornfeld Eliyahu Peter 3-Jun-19 6:57am
   
What do you mean be restarting? After F5 it still seems to work correctly...
ZurdoDev 3-Jun-19 9:15am
   
It worked for me. The score was back to zero after restarting.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100