2020-07-25

JavaScript - String HTML markup removal

str = "Miguel de Cervantes Saavedra <br/> more text here";
result = str.replace(/<\/?[^>]+(>|$)/g, "");

No comments:

Post a Comment