Skip to content
Advertisement

Replacing HTML but saving the word sticking at the end

I was working with text data, I want to remove anything HTML code that is things with “<” and “>”. For example

<< HTML > < p style=”text-align:justify” >Labour Solutions Australia (LSA) is a national labour hire and sourcing `

So I use the following code

JavaScript

With the execution of the code we get the following result

Solutions Australia LSA is a national labour hire and sourcing

I don’t want to remove the word Labour but it get remove as it’s stick with ‘>’. Is there any way I can save it? Please suggest

Advertisement

Answer

JavaScript

Output:

Labour Solutions Australia (LSA) is a national labour hire and sourcing

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