I want to place the string inside the iframe from _top
to _blank
Example :
My Domain : example.com
Data coming from iframe domain : example.net
String inside iframe
<a href="https://www.example.com" target="_top">foo</a><br />
<a href="https://www.example.net" target="_top">bar</a>
My try :
const frame = document.querySelectorAll('a[target="_top"]').forEach(el => el.target = '_blank');
My code working fine for replacing string outside the iframe but it not replacing the string inside the iframe.