Click here to Skip to main content
14,239,593 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life. Technical discussions are encouraged, but click here to ask your programming questions.

The Lounge is rated PG. If you're about to post something you wouldn't want your kid sister to read then don't post it. No flame wars, no abusive conduct, no programming questions and please don't post ads.
 
GeneralRe: WSO CCC OTD 2019-06-06 - we have a winner! Pin
PeejayAdams6-Jun-19 0:40
memberPeejayAdams6-Jun-19 0:40 
GeneralRe: WSO CCC OTD 2019-06-06 - we have a winner! Pin
pkfox6-Jun-19 1:56
professionalpkfox6-Jun-19 1:56 
GeneralRe: WSO CCC OTD 2019-06-06 Pin
glennPattonWork5-Jun-19 23:21
professionalglennPattonWork5-Jun-19 23:21 
GeneralRe: WSO CCC OTD 2019-06-06 Pin
OriginalGriff5-Jun-19 23:28
protectorOriginalGriff5-Jun-19 23:28 
GeneralMini CCCs 98 Pin
Tim Deveaux5-Jun-19 19:05
memberTim Deveaux5-Jun-19 19:05 
GeneralRe: Mini CCCs 98 Pin
musefan5-Jun-19 20:31
membermusefan5-Jun-19 20:31 
GeneralRe: Mini CCCs 98 - Done Pin
Tim Deveaux6-Jun-19 0:46
memberTim Deveaux6-Jun-19 0:46 
GeneralHow to check the answer in a quiz? Pin
Tarun Rathore 5-Jun-19 13:16
memberTarun Rathore 5-Jun-19 13:16 
I have made a sortable list to rearrange the words to make a meaningful sentence. I am unable to figure out why the alert in checking the answer section is not working. This is not working: alert('success');

$(document).ready(function () {
var words = [];
var i = 0;
function showWords() {
    $('#container').append("<ul id='list'></ul>");
    for (var j = 0; j < words[i].question.length; j++) {
        $('#list').append("<li class='box' id=" + words[i].question[j] + ">" + words[i].question[j] + " " + "</li>");
    }

    $('#list').sortable({
        placeholder: 'back',
        axis: 'x',
        opacity: '0.7'
    });
}
showWords();


$(document).on('click', '#btn', function () {
    var guess = $('.box').text();
    $('#list').empty();
    if (i < words.length); {
        var correct = words[i].answer;
        i++;
        showWords();
    }
    if (guess === correct) {
        alert('success');
    }
});
});


modified 6-Jun-19 23:01pm.

GeneralRe: How to save text of li after reordering li by applying sortable method? Pin
Mike Hankey5-Jun-19 14:32
professionalMike Hankey5-Jun-19 14:32 
JokeRe: How to save text of li after reordering li by applying sortable method? Pin
the goat in your machine5-Jun-19 15:10
memberthe goat in your machine5-Jun-19 15:10 
GeneralRe: How to save text of li after reordering li by applying sortable method? Pin
abmv5-Jun-19 19:25
professionalabmv5-Jun-19 19:25 
GeneralRe: How to save text of li after reordering li by applying sortable method? Pin
Pete O'Hanlon5-Jun-19 21:15
protectorPete O'Hanlon5-Jun-19 21:15 
GeneralRe: How to save text of li after reordering li by applying sortable method? Pin
BillWoodruff6-Jun-19 22:00
mveBillWoodruff6-Jun-19 22:00 
GeneralRe: How to save text of li after reordering li by applying sortable method? Pin
Marc Clifton6-Jun-19 0:51
protectorMarc Clifton6-Jun-19 0:51 
GeneralRe: How to save text of li after reordering li by applying sortable method? Pin
W Balboos6-Jun-19 4:46
mveW Balboos6-Jun-19 4:46 
GeneralWow, Office 365 so sucks Pin
Marc Clifton5-Jun-19 9:27
protectorMarc Clifton5-Jun-19 9:27 
GeneralRe: Wow, Office 365 so sucks Pin
  Forogar  5-Jun-19 9:44
professional  Forogar  5-Jun-19 9:44 
GeneralRe: Wow, Office 365 so sucks Pin
theoldfool5-Jun-19 10:36
professionaltheoldfool5-Jun-19 10:36 
GeneralRe: Wow, Office 365 so sucks Pin
Mark_Wallace5-Jun-19 11:12
memberMark_Wallace5-Jun-19 11:12 
GeneralRe: Wow, Office 365 so sucks Pin
  Forogar  6-Jun-19 5:27
professional  Forogar  6-Jun-19 5:27 
GeneralRe: Wow, Office 365 so sucks Pin
OriginalGriff5-Jun-19 9:53
protectorOriginalGriff5-Jun-19 9:53 
GeneralRe: Wow, Office 365 so sucks Pin
Mark_Wallace5-Jun-19 11:14
memberMark_Wallace5-Jun-19 11:14 
GeneralRe: Wow, Office 365 so sucks Pin
RickZeeland5-Jun-19 10:00
mveRickZeeland5-Jun-19 10:00 
GeneralRe: Wow, Office 365 so sucks Pin
Slacker0075-Jun-19 10:41
professionalSlacker0075-Jun-19 10:41 
GeneralRe: Wow, Office 365 so sucks Pin
Mark_Wallace5-Jun-19 11:15
memberMark_Wallace5-Jun-19 11:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.