I want to be able to remove only spans which has an id that stars with the key word “junk_”
for example if I have
<span id="junk_8345">A</span>
<span id="valid_2972">B</span>
<span id="junk_9249">C</span>
The output should look like
<span id="valid_2972">B</span>
I’ve tried to use
$("span:has(junk)").remove();
but it does not seem to work. I’m open to use regex expression with the replace function if I can accomplish the same goal. Any help would be greatly appreciated!
use the
startswithselector.