Languages

jQuery - how to add on click event to button?

14 points
Asked by:
Root-ssh
178290

I have simple html button and I would like to add on click event to this button.
When someone clicks on this button I would like to show alert.
I don't want to use plain JavaScript, I would like to achieve it with jQuery.

My button looks like this:

I would like to get element by id and attach click event with jQuery.

0 answers
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join