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


#1


https://www.codecademy.com/fr/courses/web-beginner-fr-FR-3zko8/2/3?curriculum_id=5355c479516bcbd91200000d


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.



#2

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


#3

I updated in the original post


#4

This passes:

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

#5

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.


#6

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.


#7

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