Click here to Skip to main content
15,897,704 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
PeejayAdams6-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
glennPattonWork35-Jun-19 23:21
professionalglennPattonWork35-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
Tim Deveaux5-Jun-19 19:05 
GeneralRe: Mini CCCs 98 Pin
musefan5-Jun-19 20:31
musefan5-Jun-19 20:31 
GeneralRe: Mini CCCs 98 - Done Pin
Tim Deveaux6-Jun-19 0:46
Tim Deveaux6-Jun-19 0:46 
GeneralHow to check the answer in a quiz? Pin
Tarun Rathore 5-Jun-19 13:16
Tarun 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
mveMike 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
the 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
professionalBillWoodruff6-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
W 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
Mark_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
Mark_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
Mark_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.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   282 votes