<div data-controller="hello">
    <input data-target="hello.name" type="text" data-action="input->hello#sync">
<input data-target="hello.name" type="text" data-action="input->hello#sync">
    <input data-target="hello.name" type="text" data-action="input->hello#sync">
    <input data-target="hello.name" type="text" data-action="input->hello#sync">
    <input data-target="hello.name" type="text" data-action="input->hello#sync">
  </div>
const application = Stimulus.Application.start()

application.register("hello", class extends Stimulus.Controller {
    static get targets() {
        return [ "name" ]
    }
    
    sync(ev) {
        $(this.nameTargets).val(ev.target.value);
    }
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://unpkg.com/stimulus/dist/stimulus.umd.js
  2. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js