I'm wondering why this doesn't work (on Chrome version 87.)
<html>
<body>
<button onclick="getTextContent()">Get textContent</button>
<p>Hello</p>
<script>
function getTextContent() {
alert(document.querySelector("p[textContent*='Hello']").textContent)
}
</script>
</body>
</html>
I thought tapping the button would alert with "Hello" but it does nothing.