StimulusJS 1.1.1 https://github.com/basecamp/stimulusjs

A modest JavaScript framework for the HTML you already have.

Include the following files to use this plugin

<script src="https://assets.clubcollect.com/hitman/1.0.6/vendor/stimulus.js"></script>

<script src="https://assets.clubcollect.com/hitman/1.0.6/vendor/stimulus-polyfills.js"></script>

Notes:

  1. For older browsers (IE11) you need load the polyfill also
  2. There are minified versions available (use stimulus.min.js / stimulus-polyfills.min.js)
<script>
  (() => {
    const application = Stimulus.Application.start()

    application.register("hello", class extends Stimulus.Controller {
      static targets = [ "name", "output" ]

      greet() {
        this.outputTarget.textContent =
          `Hello, ${this.nameTarget.value}!`
      }
    })
  })()
</script>

<div data-controller="hello">
  <div class="input-group mb-3 w-25">
    <input type="text" class="form-control" value="Frank" data-target="hello.name">
    <div class="input-group-append">
      <button class="btn btn-primary border-primary" type="button" data-action="click->hello#greet">Greet</button>
    </div>
  </div>
  <span data-target="hello.output">
  </span>
</div>