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

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -