Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
How do I encode in JS only what's inside tags but I don't know the order in which the tags will appear. I do know that I will only have em, strong, br and a tags tho. Look at the funny o and & below. Thanks.
<div>hello my <em>friend</em>, this is how you <em><strong>search</strong></em> <strong><a ****="
http://google.com">göogle</a></strong> & remember, don't lose your <strong><em>googliness</em></strong>...</div>
So it should encode only the special characters inside the tags but not the tags themselves.
Desired Output:
<div>hello my <em>friend</em>, this is how you <em><strong>search</strong></em> <strong><a ****="
http://google.com">göogle</a></strong> & remember, don't lose your <strong><em>googliness</em></strong>...</div>
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)