Answers for "javascript setattribute onclick function with parameters"

0

javascript setattribute onclick function with parameters

var but = document.createElement('button');

var my_string = '123-45-lol , @%# ';

var but.setAttribute('onclick', 'my_function( " '+my_string+' " )');

// Or to use addEventListener() instead of setAttribute() ?
Posted by: Guest on April-06-2020

Code answers related to "javascript setattribute onclick function with parameters"

Code answers related to "Javascript"

Browse Popular Code Answers by Language