jaredreich/pell

Hi ! There's way to get div id on onChange event ?

Simerca opened this issue · 1 comments

Hi,
There's way to obtain div id on onChange event ?
i use this thing

for(var i = 0; i < elements.length; i++){ this.pellConfig.element = elements[i]; this.pellConfig.onChange = function(e){ console.log(e); } pell.init(this.pellConfig) }

maybe you can try this:

const onChange = (id, html) => {
    console.log(id, html);
};
for(var i = 0; i < elements.length; i++){ this.pellConfig.element = elements[i]; this.pellConfig.onChange =onChange.bind(this,elements[i].id ) ; } pell.init(this.pellConfig) }