.off() trouble

.off() trouble

    I'm having trouble with the .off() method:
    1. $(document).on("click", ".npc", function(){
    2.   $("#body").append("<h3>Blah</h3>");
    3.   $(this).off("click");
    4.   });
    I'm trying to unbind the click event from .npc class after it's been clicked on, but it continually appends to body.

    I've also tried this:

    1. $(".npc").on("click", function(){
    2.   $("#body").append("<h3>Blah</h3>");
    3.   $(this).off("click");
    4.  });
    In this case it's not appending at all. Maybe because the .npc class doesn't exist initially on page load?