Tag : How to remove div content using html() in jQuery or remove and add content to the div using jQuery html

 How to remove div content using html() in jQuery or remove and add content to the div using jQuery html <html> <head> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $('#btnChangetext').click(function() { //remove the div content $("#RemovingContent").children().remove(); $("#RemovingContent").html(""); //adding content to div $("#RemovingContent").html("<a href=www.sourcecodehub.com>www.sourcecodehub.com</a>"); //you can also add one more div to #RemovingContent $("<div>hello</div>").appendTo($("#RemovingContent")); }); ..

Read more