mhdi
asked on
Javascript replace text string with h3
Hi,
Using Chrome Dev Tools I have found the CSS selector of a H3 heading.
Within the H3 heading is "Test - some more text here". I need to replace "Test" with "New".
The following attempt results in an 'undefined' error message -
Can anyone see what I am doing wrong?
Using Chrome Dev Tools I have found the CSS selector of a H3 heading.
#container > div.my-table > h3
Within the H3 heading is "Test - some more text here". I need to replace "Test" with "New".
The following attempt results in an 'undefined' error message -
document.body.innerHTML = document.querySelector('#container>div.my-table>h3').replace("Test", "New");
Can anyone see what I am doing wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.