This is my code right now.
return_btn = document.getElementById(bkid).querySelector(".returnbtn");
return_btn.onclick = cancelReturn; // I want to define arguments here
return_btn.innerHTML = "Cancel"
Here, I wish to define the onclick function as cancelReturn
while providing arguments.
For example in HTML I would write
<button class="returnbtn" onclick=cancelReturn(bkid)>Cancel</button>
How can I do something similar in javascript?
Thank you for reading this, I hope you can help me figure this out.