is possible to remove only text content from a div, i.e. leave all other elements intact and only remove text that is directly inside a div?
The simplest way would be something like this:
$('#div').html($('<div>').append($('*', '#div')).html());