There is a div, I insert the data that comes from the ajax request into it:
function onAjaxSuccess (data)
{
$ ("# divShow"). append (data);
}
Need a function to clear the div content, tried it like this:
function DeletePrice ()
{
$ ("# divShow"). remove ();
}
The content is deleted, but now data insertion is possible only after refreshing the page, as I understand it, DeletePrice deletes the block itself, not its content.
Question: how to remove content div?
Answer 1, authority 100%
To remove all children of an element in jQuery there is empty method .
$ ('# divShow'). empty ();