I can't get my jquery function to work even when I have two pieces of identical code.
Here is the primary jquery function (i've removed the "<").
$(".spoiler").append("<button> Reveal Spoiler!</button>");
$(".spoiler button").click(function() {
    $(this).remove();
});
This creates a button that is then removed when it is clicked.
Now when I do this:
$("#family-question").click(function(){
    $("#answer-one").append("<button> Answer One </button>");
    $("#answer-two").append("<button> Answer Two </button>");
    $(".test").append("<button> Answer Three </button>");
});
$(".test button").click(function() {  
    $(this).remove();
});
This creates all the buttons. However if I click the button it isn't removed.
In terms of the HTML code. first one is;
<p class="spoiler">
    <!--Spoiler:-->
    <span>Darth Vader is Luke Skywalker's Father! Noooooooooooo!</span>
</p>
The second one has an ID as well as a class;
<p class="test" id="answer-one">
  <span>Answer Option one</span>
  </p>
Why doesn't it work?
 
     
    