Skip to content
Advertisement

Remove certain character from string and return into an array

I’ve got a string that has html tag like this:

JavaScript

how can I remove every character of The u, p, li tags

so i can get return result in array like this :

JavaScript

Advertisement

Answer

You can create a div and then find all the text using innerText using querySelectorAll and array#map.

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement