Copy link to clipboard
Copied
I need to set "onClick" like a variable, something like this:
<script>
var = MyVar;
MyVar = x;
function MyFunction + MyVar (){
MyCode;
}
</script>
<button type="button" onClick="MyFunction + MyVar()"> </button>
Is there a way to set this?
Thanks;
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you Ben!
If I'm right in "Tryit Editor" I get the value from the onClick, what I need is the opposite:
assign a var to "onClick"
Thank you again.