c_pattle Posted December 28, 2010 Share Posted December 28, 2010 I'm have a bit of trouble using jQuery bind. I have a function that I want to run on two different event types on 2 different elements. Basically I want to merge the two event types below into one. I have tried using bind but am not sure how to do it. Any help would be great. $(".validate").change(function() { $(".validate2").keyup(function() { Quote Link to comment https://forums.phpfreaks.com/topic/222802-jquery-bind-problem/ Share on other sites More sharing options...
trq Posted December 28, 2010 Share Posted December 28, 2010 You'll need to name your function instead of using an anonymous one. var foo = function() { // code } $(".validate").change(foo); $(".validate2").keyup(foo); Quote Link to comment https://forums.phpfreaks.com/topic/222802-jquery-bind-problem/#findComment-1152064 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.