Do the following steps:
- Create a new
documentFragment
- Put your HTML string in it
- Use selectors to get what you want
Why do all the parsing work – which won’t work anyways, since HTML is not parsable via RegExp – when you have the best HTML parser available? (the Browser)