Run Javascript on select change

I have a richeditor and select field in a form. The select field is a relationship which Model also contains a richeditor field.

I now want the richeditor field from the form to be auto-filled with the currently selected relation's richeditor content. Is there a way to trigger javascript and pass the relationship's model data on select change?

My current Idea is to add a livewire component to the schema function of the form which only contains javascript and then adding a changed listener to the select input. I however don't know how to fetch the relationship data using this approach. Does anyone have a idea to do this/inject javascript into a form page as well as getting the Model data of the selected relationship?
Was this page helpful?