I want to delete table element. Not from DOM. but from the string by jQuery as an element. Here is the code:
var content = $('<table cellspacing="0" cellpadding="0" border="0" class="testclass"><tbody><tr><td>test</td></tr></tbody></table>');
content.each(function(){
$(this).remove();
});
console.log(content.prop('outerHTML'));
jQuery can remove if there will be more than 1 table. For example 2 or 3. And the last 1 will still. When there is only 1 table left in the string, .remove() function not working at all. There will be always still 1 final element that cannot be removed. The last one. But i need zero elements for example.