Q:

jQuery: What is wrong here?

This is my first question here.
First of all have a look at this code
 $("body").on("click", "#showstore", function() {
    $('#foo a[href="' + $('.container').children('a').attr('href') + '"]').remove();
 });

HTML
<div id="showstore">Button</div>
<div id="foo">
  <a href="http://jsfiddle.net/">hello</a>
  <a href="http://google.com/">okay</a>
</div>
<div class="container">
  <a href="http://jsfiddle.net/">bye</a>
  <a href="http://google.com/">see</a>
</div>

On clicking '#showstore' only the first 'a' is being removed. How can I make it remove all the matched 'a' from #foo?
jsFiddle :: http://jsfiddle.net/xr3gjvxx/27/

A:

selector in your code is targeting anchor tags under #foo, that has to be changed to all anchor tags.
change 
$('#foo a[href="' + $('.container').children('a').attr('href') + '"]').remove();

to 
$('a[href="' + $('.container').children('a').attr('href') + '"]').remove();

update - 1
Your code is trying to remove all anchor tags under #foo which are having href="http://jsfiddle.net/" which is only one in your code above and gets removed. If you are trying to remove all the anchor tags under #foo irespective or the href value, then try
$('#foo a').remove();

update - 2
Ok if you need to loop over each child and remove the anchor tags, then try
$( "body" ).on( "click", "#showstore", function() {

    $('.container').children('a').each(function(){

        $('#foo a[href="' + $(this).attr('href') + '"]').remove();

    });

});

Here is a sample fiddle.

