• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Set "onClick" like a variable

Contributor ,
Jan 12, 2019 Jan 12, 2019

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;

Views

310

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 12, 2019 Jan 12, 2019

Copy link to clipboard

Copied

See Tryit Editor v3.6

Wappler, the only real Dreamweaver alternative.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 12, 2019 Jan 12, 2019

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines