How to attach one event to multiple selector in jquery? -


how can attach 1 event multiple selector?

for e.g.

 $("#selector1 #selector2").change(function() { //not valid code        alert("hi");        ... } 

tia

use commas between selectors. if want multiple events, you'll need use on , specify there

$("#selector1, #selector2").change(function() { //not valid code     alert("hi"); } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

android - IBM Worklight 6.1 [Application Error] There was a network error (file:///android_asset/www/index.html) -