Add DIV dynamically with JQuery

You can add new div inside your web page by jquery always you want. You’ve to add the following code in your javascript function:

$("#myExistentDiv").append("<div id='MyNewDiv'>This is my dynamic DIV</div>");

In this case, you’re adding the div “MyNewDiv” inside your div with ID “myExistentDiv”, just at the end of it.
You can read more in the official JQuery API Documentation here: http://api.jquery.com/append/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.