anchor tag target iframe not working and link opening in new tab

On click of the link, the link is opening on a new tab on the browser and not in iframe and iframe is a blank box

<iframe name="iframenew" height="300px" width="100%" title="Iframe Example"></iframe>
<p><a href="https://alight.com" target="iframenew">AVA</a></p>

I want the link to open in the iframe itself


Solution 1:

Are you refers to the message alight.com refused to connect.?

Some websites disable embedding iframe, you could check using X-Frame-Options

When attempting to embed an iFrame into your course, you may occasionally run into some errors such as seeing a blank white box or error notification. This is because not all websites can be embedded.

<iframe name="iframenew" height="300px" width="100%" title="Iframe Example"></iframe>
<p><a href="https://alight.com" target="iframenew">AVA</a></p>

There is nothing wrong with the code, you could see below, I switch the link to Wikipedia main page, it will work find.

<iframe name="iframenew" height="300px" width="100%" title="Iframe Example"></iframe>
<p><a href="https://en.wikipedia.org/wiki/Main_Page" target="iframenew">AVA</a></p>