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 -

google shop client API returns 400 bad request error while adding an item -