Change specific text color in textbox

Hello everyone!
Does any wix code expert knows how to change the color of some letters (or words) in a textbox while the user is writing ?
For example, every “)” should be in red while the rest is in black. Is it only possible in a text box?
Many thanks to whoever try to solve this puzzle! :heart:
Cheers!
Paul

@Paul

Using wix code I do not believe you will have the access to the necessary text box properties. With text elements however you do have access to html color properties, i.e the user could type into the input box and then display their inputted data as a text element.

Code something like this…

$w.onReady( function () {

$w(‘#input1’).onKeyPress( function () {

setTimeout(() => { 

let lenghtInput = $w(“#input1”).value.length;

console.log(lenghtInput);

let previousLetters = lenghtInput - 1

$w("#text1").text = $w("#input1").value; 

$w(“#text1”).html = “” + $w(“#text1”).text.slice(0, previousLetters) + “” +
” + $w(“#text1”).text.slice(previousLetters, 400) + “”;

}, 10); 

})
})

As mike said, you can use different styles in 1 string only with text elements but not with user input elements (if you use native Corvid).
If you must have a user textual user input field that supports mixed styles, you’ll have to create it using html code and put it inside an html component.

Thank you for the code example Mike! And as you suggested JD, I’ll try to create a user input field myself using HTML. Thank’s again guys that’s great help