Click here to Skip to main content
15,028,757 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
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
glennPattonContracting25-Jun-19 23:21
professionalglennPattonContracting25-Jun-19 23:21 
GeneralRe: WSO CCC OTD 2019-06-06 Pin
OriginalGriff5-Jun-19 23:28
mveOriginalGriff5-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
mvePete 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
mvaMarc Clifton6-Jun-19 0:51 
GeneralRe: How to save text of li after reordering li by applying sortable method? Pin
W Balboos, GHB6-Jun-19 4:46
mveW Balboos, GHB6-Jun-19 4:46 
GeneralWow, Office 365 so sucks Pin
Marc Clifton5-Jun-19 9:27
mvaMarc 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
mveOriginalGriff5-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.