How can i set the onclick property for an element like link or button when it's created with Javascript or how can i set an eventListener?
I create the Button with JavaScript, set an Id and add a Class.
var button=document.createElement('button')
button.className="btn btn-sm btn-danger listening_class_for_delete"
button.appendChild(delete_text_button)
button.setAttribute('id',id);
// how can i set 'onclick' here
// output shall be:
<button ... onClick="functionName"></button>