jibeinc/juice

View on GitHub
examples/button.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
<head>
  <title>Button Example</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
  <script src='../dist/ui.js'></script>
</head>
<body>

  <form>
    <div class='button-container'></div>
  </form>

  <script>
    var btn = new UI.Button('.button-container', {
      label: 'Search',
      submit: true
    });

    btn.subscribe(function () {
      console.log('clicked!');
    });

    btn.render();
  </script>

</body>
</html>