How to append data to div using JavaScript?

前端 未结 11 1967
忘了有多久
忘了有多久 2020-11-22 09:39

I\'m using AJAX to append data to div element, where I fill the div from JavaScript, how can I append new data to the div without losing the previous data found in div?

11条回答
  •  一向
    一向 (楼主)
    2020-11-22 10:09

    you can use jQuery. which make it very simple.

    just download the jQuery file add jQuery into your HTML
    or you can user online link:

    
    

    and try this:

     $("#divID").append(data);
    

提交回复
热议问题