I need some help adding style to specific text within an input field.
For example, if the user types in "Hello world" and the special text is "world"
I want to achieve this result:
https://i.sstatic.net/Ozd6n.png
This is what my HTML code looks like:
<input name="inputTest" ng-model="inputTest">
My JavaScript function is triggered by an external button that calls the "checkInput" function
let specialText = "world"
textArr = inputTest.split(/(\s+)/);
for(const text of textArr){
if(text == specialText){
//Do something to change style of the "special text"
}
}