Strange javascript behaviour

Strange javascript behaviour

I've this snippet

  1. $('BODY').on('click', '.evidence_check', function() {
  2.       var that = $(this);
  3.       ...
  4.       $.ajax({
  5.             ...
  6.       }).success( function (data, status, xhrObj) {
                obj = $.parseJSON(data);

                console.log ( $(that).parent() );
                $(that).parent().html(obj.img);
                console.log ( $(that).parent() );
               
            });

I ask you a explanation of this:


The FIRST console.log correctly give me the parent of target HTML element (it's a table cell)

I set the img, and it's wokring

The SECOND console.log give me jQuery() .. and not the same HTML element of first log

Why? I know it's not a bug, but i'd like to have more info about why this is happening


I'm using lastest Firefox