Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
Open HTML page with href

I have HTML template code like

<!doctype html>
<html>
<head>
<title>Our Funky HTML Page</title>
<meta name="description" content="Our first page">
<meta name="keywords" content="html tutorial template">
</head>
<body>
Content goes here.
</body>
</html>

I want generate a link in my html template who render this code into a new page For now I have done a function like this

function stringToHtml(htmlString: string) {
  let parser = new DOMParser();
  let doc = parser.parseFromString(htmlString, 'text/html');
  return doc.body;
}

who take html string (my template) as argument.

In my template (where I need to render this link) I interpolate this function

function generateLink(myHtmlTemplate: string, text: string){
  const page = stringToHtml(myHtmlTemplate)
  return `<a href="${page}" target="_blank">${text}</a>`
}

But I don't know I can I do to open the HTML render after a click on the link

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!