To append the data to <div> element we have to use DOM(Document Object Model) manipulation techniques. The approach is to create a empty <div> with an id inside the HTML skeleton. Then that id will be used to fetch that <div> and then we will manipulate the inner text of that div.
document.getElementById("div_name").innerText += "Your Data Here";
- Before Adding the Data:
- After Adding the Data:
- How to Convert Data URI to File then append to FormData?
- How to append an element in two seconds using jQuery ?
- How to change opacity of every data element on hover in a table using CSS ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.