I am curious about how you will handle the scenario when the innerHTML content has an HTML element.
When pet.description is <a href="#"><span>State</span></a>, and the user just enters the letter s in the search field.
The current codebase will break as the element span has also the letter 's'.
Hi Pranar, thanks for taking the time to review my post. As I stated in the post, this solution met my requirements and if need be, you can tweak it. My use case did not call for having an html element within. I'd love to hear how you would approach this situation.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am curious about how you will handle the scenario when the innerHTML content has an HTML element.
When
pet.description
is<a href="#"><span>State</span></a>
, and the user just enters the letters
in the search field.The current codebase will break as the element span has also the letter 's'.
Hi Pranar, thanks for taking the time to review my post. As I stated in the post, this solution met my requirements and if need be, you can tweak it. My use case did not call for having an html element within. I'd love to hear how you would approach this situation.