Skip to main content
Jhon Carlo
Inspiring
Jan 12, 2019 9:46 AM UTC
Question

Set "onClick" like a variable

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;

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

BenPleysier
Community Expert
Community Expert
Jan 12, 2019 10:15 AM UTC

See Tryit Editor v3.6

Translate
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Jhon Carlo
Inspiring
Jan 12, 2019 11:37 AM UTC

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.

Translate