Search code examples
meteormeteor-blaze

how to customize html element using blaze


A simple example so you can understand me:

I have a template called button:

<template name="button">
   <button>
      //some content
   </button>
</template>

then when i click it how to customize it using JS

Template.button.events({
   'click': function (e, t) {
      var b = e.currentTarget;
      // what i must do here ?
   }
});

Solution

  • Template.button.events({
      'click button': function (e, t) {
        let b = e.target
        b.style.width="100px"
    }
    })