.replace(/(<div[^>]*>|<\/div>)/g, "").replace(/(<span[^>]*>|<\/span>)/g, "").replace(/(<p[^>]*>|<\/p>)/g, "");
(tag에 id, class, style 등 속성이 많이 포함되어 있어도 삭제할 수 있다.)
.replace(/ class="[^"]*"/g, "").replace(/ style="[^"]*"/g, "").replace(/ colspan="[^"]*"/g, "").replace(/ rowspan="[^"]*"/g, "");
.replace(/(<div[^>]*>|<\/div>)/g, "").replace(/(<span[^>]*>|<\/span>)/g, "").replace(/(<p[^>]*>|<\/p>)/g, "").replace(/ class="[^"]*"/g, "").replace(/ class="[^"]*"| class=[^ >]*/g, "").replace(/ style="[^"]*"/g, "").replace(/ colspan="[^"]*"/g, "").replace(/ rowspan="[^"]*"/g, "");
<div style="width: auto; overflow: auto;">
<table class="custom-table" style="white-space: nowrap; width: auto;">
<thead>
<tr><th></th></tr>
</thead>
<tbody>
<tr><td></td></tr>
</tbody>
</div>