<h1>Product<span>4.0%</span></h1>
In the above HTML block, I would like to query and fetch the innerText of only the <h1>
element, excluding the span element.
However
document.querySelector('h1:not(span)').innerText
outputs: 'Product4.0%'
I would like the output to be: Product