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
Post a Comment