I have a anchor tag. On click of it, I create an anchor tag and set the href attribute.
Something like this:
<a onClick={() => linkClick(url)}> Text </a>
const linkClick = (url) => {
const tag= document.createElement('a');
tag.rel = 'noopener noreferrer';
tag.target = _blank';
tag.href = url;
tag.click();
}
The issue I am facing here is, when I hover over the a tag, the URL preview is not available (Which usually appears at the bottom left) since href attribute is not present. Can you please help me here. (I dont want to add href attribute).