JavaScript How can I send custom data to JQuery click event? send custom data to google analytics,send custom data to

I have this JQuery click event:

jq("#generateButton").click({key: "hello world"}, function () {
            console.dir(this);// this is the "generateButton" html element. 
        // jq(this) would be the jquery object of the generate button
            frnConstr.setDataObject(this);
        frnConstr.gameObject.state.start(frnConstr.EnteriorScreen.KEY);
    });

How could I possibly send custom data to this event, for example print {key: "hello world"}? Is it at all possible?

Note: In my custom made working environment jq() is $() or jquery().

Note: jQuery docs say that eventData can be anything, here's the official doc: https://api.jquery.com/click/ :)

Answer:1

You can't but a way around is to have a data attribute in your html and get that attribute on click of that element.

eg:

 <button id="generateButton" data-key="something"/>

jq("#generateButton").click(function () {
    console.log($(this).data('key')); // something
    .....
});
Answer:2

I know this is something usual, With the earlier versions of chrome I used to set "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --args --disable-web-security --user-data-dir in chrome ...

I know this is something usual, With the earlier versions of chrome I used to set "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --args --disable-web-security --user-data-dir in chrome ...

  1. google chrome wildcard certificate issue
  2. google chrome wildcard certificate
  3. google chrome wildcard search
  4. google chrome find wildcard
  5. google chrome pop up blocker wildcard

According to developers.google.com it is possible to defer the Web App Install banner, however I have only been able to cancel it completely. window.addEventListener('beforeinstallprompt', function(e)...

According to developers.google.com it is possible to defer the Web App Install banner, however I have only been able to cancel it completely. window.addEventListener('beforeinstallprompt', function(e)...

I would like to create expanding abbreviations, like on this website. However the the CSS and JS are minimized and there are so many tags, I got stuck with my limited knowledge. So far I have the ...

I would like to create expanding abbreviations, like on this website. However the the CSS and JS are minimized and there are so many tags, I got stuck with my limited knowledge. So far I have the ...

I have a simple text editor in which i used the content editable div as shown below: <div contentEditable=true id = "message"></div> Now, what I want is to disable pasting of styled ...

I have a simple text editor in which i used the content editable div as shown below: <div contentEditable=true id = "message"></div> Now, what I want is to disable pasting of styled ...

  1. allow only text in excel cell
  2. allow only text in textbox html
  3. allow only text in edittext android
  4. allow only text regex
  5. allow only text in textbox jquery
  6. allow only text in textbox asp.net c#
  7. allow only text in textbox jquery on keypress
  8. allow only text in textbox angularjs
  9. allow only text in textbox
  10. allow only text in textbox html5
  11. allow only text in textbox angular 2
  12. allow only text in textbox c#
  13. allow only text in textbox angular 6
  14. allow only text in textbox using jquery
  15. allow only text excel
  16. allow only text in textbox mvc
  17. allow only text in textbox vb.net
  18. allow only text in textbox javascript onkeypress
  19. allow only text in excel column
  20. allow only text android