user4540334
user4540334

Reputation:

Javascript Add data to div

I have the javascript code that ONCLICK retrieves text from another PHP file and Puts it in DIV. The main code works, but I need to ADD retrieved text to Div content. Instead of that, it´s replacing content of DIV with retrieved text.

  $.post("getdata/some.php",{partialStates:option.value},function(data){
  $("#some").html(data);

Div id=some

Thanks in advance.

Upvotes: 1

Views: 80

Answers (1)

Karthik N
Karthik N

Reputation: 951

Try the jquery append method

$('#some').append(data);

instead of

$('#some').html(data);

Upvotes: 3

Related Questions