var str = 'test TEST';
How to get str = ‘<span class="red">test</span> <span class="red">TEST</span>‘ in return.
Thanks a lot.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The following will work for words composed of characters matched by
\w, which are a-z, A-Z, 0-9 and _. This means, for example, that it will fail for words containing accented characters, but will work fine for your example.