I always get links similar to this, I need to execute the link to execute the redirection.
I thought I would do it with location.href
location.href ="http://xxx.com/index.php?x=xx";
But it would require extracting only the link and I do not think it can be done since the links vary.
let enlace = ' <a class="btn" href=http://xxx.com/index.php?x=xx>Ir al enlace</a>';
console.log(enlace);
I thought I would do it with RegExp but I do not think it can be because of the variation of the characters.
The last possibility that occurs to me is to create the element from that string and execute that link for the resend, I think it is the most viable.