Menu icon Foundation
F6.5.3 adding js code

Sorry by advance for the very silly question, but I didn't use Foundation for a while.

I'm using the Zurb Template installed with NPM, so I got a src folder and dist folder.
I would like to add for example this short code :

$(function () {
  var showClass = 'show';

  $('input').on('checkval', function () {
    var label = $(this).prev('label');
    if(this.value !== '') {
      label.addClass(showClass);
    } else {
      label.removeClass(showClass);
    }
  }).on('keyup', function () {
    $(this).trigger('checkval');
  });
});

This code is from https://foundation.zurb.com/building-blocks/blocks/floated-label-wrapper.html
How to implement it ? Ive tried to put it in app.js but it doesn't work...

Thx in advance :)

jsFoundation

Sorry by advance for the very silly question, but I didn't use Foundation for a while.

I'm using the Zurb Template installed with NPM, so I got a src folder and dist folder.
I would like to add for example this short code :

$(function () {
  var showClass = 'show';

  $('input').on('checkval', function () {
    var label = $(this).prev('label');
    if(this.value !== '') {
      label.addClass(showClass);
    } else {
      label.removeClass(showClass);
    }
  }).on('keyup', function () {
    $(this).trigger('checkval');
  });
});

This code is from https://foundation.zurb.com/building-blocks/blocks/floated-label-wrapper.html
How to implement it ? Ive tried to put it in app.js but it doesn't work...

Thx in advance :)