Exercise 12. "Ajouter à la fin du body" - correct code does not pass - Workaround


#1



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


Yo,

My code seems to work on this one, all elements are added on the bottom (it's in red).
Soooo, why the heck does the SCT won't let me pass ? I can spam click the add button with and without things on the input. It doesn't do anything.

Error message : Oops try again. Please follow the instructions on the Full Preview page to test your code.

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

I didn't touch anything else.


#2

Oh well, I just pass with a code who got a SyntaxError.
You should patch this exercice.


#3

3 posts were split to a new topic: 12. Ajouter à la fin du body


#4

This lesson expects you to click on #buoton and we have it set to #button thus it doesn't work,

What you need to do:

In HTML

<!-- Change --> <div id="button">Add!</div>
<!-- To: --> <div id="bouton">Add!</div>

In CSS

//change
#button{
//to:
#bouton{

In jQuery

//change 
$('#button').click(function() {
// to
$('#bouton').click(function(){

#8

#9