javascript - Many css ids to the same jquery function -


$("#myinputid1").blur(function() 

how can do:

#myinputid1, #myinputid2, #myinputid3 -> same blur function 

i believe that's not hard, tried many things , cant!

try this:

$("#myinputid1, #myinputid2, #myinputid3").blur(function(){    //your code }); 

or other way can check id starts myinputid :

$('input[id^=myinputid]').blur(function(){    //your code }); 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -