counting characters in text box

sorry but the previous track I was reading didnt help me implement this on a text box input. I need more assistance.

$w.onReady(function () {
export function textBox2_change() {
const remainingLength = $w(‘#textBox2’).maxLength - $w(‘#textBox2’).value.l

$w.onReady(()  => {
$w("#textBox2").onChange(event => {
    const remainingLength = $w('#textBox2').maxLength - $w('#textBox2').value.length;
})
})