How to detect if a button has been clicked OR an input's value has changed using jQuery? -
My goal is to do something if the value of an input changes or a button is clicked.
I know how to apply these separately for example:
$ ('form: input') .change (function () {// something Do.}); $ ('Button'). Click (function () {// do something.}); But how can I apply them together? Here are some pseudo-code examples that I'm trying to achieve:
If (button is clicked) or (change input value) {// do something}
How to define a function and in the same case are calling the same function?
Something like this:
function f () {// your stuff} $ ('form: input'). Change (F); Click on $ ('button)' (f).
Comments
Post a Comment