javascript setattribute onclick function with parameters
var but = document.createElement('button');
var variable = 'some string';
var but.setAttribute('onclick', 'some_function( " '+ variable +' " )');
// Or to use addEventListener() instead of setAttribute() ?