Q:

Change only active div and not all classes with same name

I have a set of classes with a button, when I'm pressing the button on one of them. The change become in all the classes. But I want it only be on the active div.
I know I should use $this. but I haven't be able to manage it. Any ideas ?
function close(){
      $('.close').click(function() {
        $.ajax({
            url: "php/functions.php",
            type: "POST",
            data: "php",
            success: function(html) {
               var note =  $(".note").html(html);
            }

        });

 return false;
});
}

The php file is just containing an echo 
<?php echo "Heloo" ?>

The html
<div class="note">
<div class="close"></div>
</div>
<div class="note">
<div class="close"></div>
</div>

A:

What you want is this-
$('.close').click(function() {
  var $this = $(this);
  $.ajax({
    url: "php/functions.php",
    type: "POST",
    data: "php",
    success: function(html) {
        $this.closest(".note").html(html);
        //or
        $this.parent().html(html);
        //or
        $this.parent().html(html);
    }
  });
});

However, this will overwrite your close div. If you want to keep your close div -
HTML:
<div class="notewrap">
  <div class="note"></div>
  <div class="close"></div>
</div>
<div class="notewrap">
  <div class="note"></div>
  <div class="close"></div>
</div>

Javascript (only use one of the provided options in the callback):
$('.close').click(function() {
  var $this = $(this);
  $.ajax({
    url: "php/functions.php",
    type: "POST",
    data: "php",
    success: function(html) {
        //Option 1 - will work even if you change the html structure a fair bit
        $this.parents(".notewrap").find(".note").html(html);
        //Option 2 - will only work if your structure remains very similar
        $this.siblings(".note").html(html);
        //Option 3
        $this.parent().find(".note").html(html);
    }
  });
});

