12. Append to body - Just to point out a bug in french and the way to fix it



The editor forces you to click on "#bouton" but the item is generated with an id="button". So even if the code works the exercise cannot be completed because he doesn't detect that you pressed "#bouton".
To fix it just change in the HTML and the CSS the id to bouton and call $('#bouton') in the javascript.


May we have a link to the exercise, please. Thanks.


I updated in the original post


This passes:

    $('#bouton').click(function() {
        var aAjouter = $('input[name=elementCheckList]').val();
        $('.list').append('<div class="item">'+aAjouter+'</div>');


You are right but that was not the issue.

The issue is that the code that was automatically generated was with the id="button" and not id='bouton'
And that little detail didn't let me finish the course. To correct that I had to change all the id to bouton.

Maybe it's because I was in english in my settings and changed to french.


I see what you mean. It was a long time ago when I did this so can't remember if any change was needed. Good that you found this discrepancy.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.