I\'m trying to use javascript to create a button that has a onclick event that calls a function defined in the head that takes in as parameter a dom object relative to the
You can also use the built-in setAttrbute javascript function.
var newButton = document.createElement("button") newButton.setAttribute("onclick", "blah(this.parentNode.value)")
Hope it will help