Remove What's Been Clicked


#1

I have just completed this Task and was just wondering if it's supposed to act buggy?

Bug one: when an item is added the search bar drops down about 10px.
Bug two: when a second item is added it is duplicated so there are three items listed.
Bug three: Once items removed list and search bar continue to drop down when a new item is added.

I get that it's a learning exercise but shouldn't it work properly?



#2

What may be perceived as a bug could be some fault in your code. Please post what you have so far.


#3

I will send what I have, the site did say it was correct and to move on however.

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

#4

This selector applies to all div elements, AND #list. The only selector needed is #list.


#5

OK so I tried that and it then decided to not work at all...
But I read through the css and noticed it is a list class and an ID so it
now works fine.
Thanks for the help.

Not sure why it said it was complete and keep going though. :stuck_out_tongue:


#6

The SCT must have detected expected elements and let it pass. The #list did look a little out of place. Good that you dug through the style sheet to nail down that it is indeed a class.


#7

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