1

I am using Vue with Laravel. How can I remove HTML tags from content in Vue component

Its like this

<p> some content </p>

I want it like this

Some content

Thanks

0

1 Answer 1

1

Use regEx to remove html tags from string.. I think this example will help you, check the console in snippet

var str = "<p> some content </p>";
console.log(str.replace(/<\/?[^>]+(>|$)/g, ""));

Sign up to request clarification or add additional context in comments.

1 Comment

It's really not recommended to try and parse HTML with regex.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.