Im looking a way to get an element id by a partial inner html
For exemple, I have this template
<div id="unpredictable-id1">
<label>
<span id="unpredictable-id1"> (unpredictable text) </span> <!-- this span have has the same id than div but has unpredictable content -->
<span>persistant text</span> <!-- this span have no id, no class, no identifier -->
</label>
</div>
I cant guess the <div>
id (no suffix, no prefix, no other attributes ...)
the only way I have to get the element is by a text in an inner span (a text that I can find before)
I've tried thing like identifiers = document.querySelectorAll("[textContent*='persistant text']").id
; but always return 'undefined'
Does anyone have a lead?