Thursday, 6 May 2021

Make parseFromString() parse without validation

I use parseFromString() to create elements. Each element is individual and should be inserted into the DOM later.

This works fine, except for this string:

<tr> <td>a</td> </tr> <div>X</div>

parseFromString

How to parse the <tr> and <div> so that I have a list of two elements?

Update

I know that I could parse this easily:

<table><tr> <td>a</td> </tr></table> <div>X</div>

But in this case I really would like to parse <tr>...</tr> <div>..</div>.

Related htmx issue: #469



from Make parseFromString() parse without validation

No comments:

Post a Comment