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? -

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

ajax - PHP/JSON Login script (Twitter style) not setting sessions -