Skip to content
Advertisement

How to find strings between square brackets and wrap them in a CSS class

I have the following paragraph:

deemed to be safe and effective for fat reduction by about 20% at certain body sites. As a medical procedure, cryolipolysis is a nonsurgical alternative to liposuction.

How can I find all strings in a [ ] and wrap them in a preferred class?

JavaScript
JavaScript

Advertisement

Answer

You can find text and wrap that contain with div class hidden like below.

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