Question about "binding" simple html input to Y.Text shared text type

In order to “bind” to a Y.Text shared text type is the preferred way of changing the text inside the type to delete it out, then re-insert? Like the following?

  //called whenever a user types in the html input field
  inputTextChanged(inputText) {
    this.ytext_sharedText.delete(0, this.ytext_sharedText.toString().length);
    this.ytext_sharedText.insert(0, inputText);

This seems to work fine, but I don’t know if this would be a bad practice? In the future I’ll be wanting to do this with multiple html form controls.