Onchange on activeInput() inside a widget not working

Hello community,

I have this line at the end of the Run() from a InputWidget().

return Html::activeInput('text', $this->model, $this->attribute, ['class' => 'form-control', 'onchange' => 'getAddress()']);

Who generate this in the HTML page:

<div class="form-control" onchange="getAddress()">
  <input type="text" id="sladdress-address" class="form-control" name="SlAddress[address]" value="" onchange="getAddress()">
 </div>

All is working fine, except the script never gets called.

<script type="text/javascript">
  function getAddress() {
    let list = $('sladdress-address').val().split(",");
    document.getElementById("sladdress-address1").innerHTML = list[0];
    document.getElementById("sladdress-city").innerHTML = list[1];
    document.getElementById("sladdress-state").innerHTML = list[2];
    document.getElementById("sladdress-country").innerHTML = list[3];
  }
</script>

Any clue?
Thank you.

Is the script loaded after the widget?
Any error message in the client debugger?

Also have a look here:
https://www.yiiframework.com/doc/guide/2.0/en/output-client-scripts

Yes, everything was there.
Don’t know what’s wrong.
But I found another way to do what I wanted.

Thank you.