The code in your TinyMCE is not part of the DOM, it's a string.
But Thanks to JQuery, you can manipulate HTML strings as if they were part of the DOM.
Click the Do Stuff Str
Button, to see how the table's content as string gets manipulated.
You need to adapt this example to work with the string from your TinyMCE and write the string back to the editor when you're done.
$(document).ready(function() {
function remove_trs() {
$("tr").remove(".problem_display_work");
}
function remove_trs_str(str) {
// pass your HTML string to this function
$str = $(str);
$(".problem_display_work", $str).remove();
return $str;
}
$("#do_stuff_dom").click(function() {
remove_trs();
});
$("#do_stuff_str").click(function() {
var html_str = $("#my_tbl").html(); // string from your TinyMCE
var $ret = remove_trs_str(html_str);
console.log($ret.html());
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<div>
<table id="my_tbl">
<tr class="problem_display_work">
<td>this will be removed</td>
</tr>
<tr class="something_else">
<td>this will be kept</td>
</tr>
</table>
</div>
<button id="do_stuff_dom">Do Stuff DOM</button>
<button id="do_stuff_str">Do Stuff Str</button>
There's really no need to pass the HTML to PHP to do what you want.