I need to modify the message inside an H2 element with the code provided below. I want to change the text from
No results were found for this query: <em class="querytext">
to "No results were found by hello world!
, but the catch is that I cannot directly edit the HTML code. Is there a way to achieve this using CSS or JavaScript? Maybe using an if condition to detect the specific string and then replacing it upon page load? For example, if the text equals No results were found for this query:
, then display "No results were found by hello world!"
.
<div class="search-results">
<h2>No results were found for this query: <em class="querytext"></em></h2>
</div>