I have a problem by selecting an element by jQuery.
I have an HTML table that has a special field. You can see the structure of the field here:
<td>
<em class='block'>Create Events:</em>
-
<hr style='margin: 8px 0;'>
<em class='block'>Update Events:</em>
-
<hr style='margin: 8px 0;'>
<em class='block'>Required object:</em>
</td>
I want to delete the row (the parent element of the td element) if after the first em element follows a "-" (like in the example above).
Sometimes there is something else like in this example:
<td>
<em class='block'>Create Events:</em>
here is something else and this line should not get removed
<hr style='margin: 8px 0;'>
<em class='block'>Update Events:</em>
-
<hr style='margin: 8px 0;'>
<em class='block'>Required object:</em>
</td>
I know how to select elements by class Name or element name or the first child of an element.
But in this case, nothing worked. How can I get the text behind the first em element and test if it is "-" and not an outer string?