jquery binding same event to 2 selectors -


i have 2 classes: class1 , class2.

for now, have 2 function calls calling same myfunction function:

$('.class1').click(function () { myfunction() }); $('.class2').click(function () { myfunction() }); 

how rewrite "when there's click on class1 , on class2 call myfunction".

thanks.

$('.class1, .class2').click(function () { myfunction() }) 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -