<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);
}
})
This Pen doesn't use any external CSS resources.