Ajax in textfield adding extra div in markup
I have checked ajax.js in Drupal site and I have found that extra div is added as ajax wraps new content inside an empty div after a successful ajax request.

Comment Mentioned in ajax.js:


  We don't know what response.data contains: it might be a string of
  text without HTML, so don't rely on jQuery correctly iterpreting
  $(response.data) as new HTML rather than a CSS selector. Also, if
  response.data contains top-level text nodes, they get lost with either
  $(response.data) or $('&lt;div&gt;&lt;/div&gt;').replaceWith(response.data).


Code:

var new_content_wrapped = $('&lt;div&gt;&lt;/div&gt;').html(response.data);
var new_content = new_content_wrapped.contents();


Check this also.