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

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -