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)
})