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

132
Views
Replace an Angular-material tag with an HTML tag using Javascript

I'm using an angular material tag which is <mat-label>. The problem is that this tag is not working properly when I try to generate a PDF file of the HTML code using the html2pdf library. I need to change it to <label> in order to make it work.

Is there any way to replace that tag dynamically with a javascript function?

This is what I'm trying to do, but I'm not sure if it is the right way. matLabel is not recognized as an HTML element:

Array.from(document.querySelectorAll('mat-label')).forEach((matLabel) => {
   const label = document.createElement('label')
   label.title = matLabel.title;
   matLabel.style.display = 'none'
   matLabel.parentElement.append(label)
})
about 4 years ago · Santiago Trujillo
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!