Jquery binding event on selected class

Posted by Andrew on Stack Overflow See other posts from Stack Overflow or by Andrew
Published on 2010-04-04T18:18:10Z Indexed on 2010/04/04 18:23 UTC
Read the original article Hit count: 248

Filed under:
|
|
|
|

Is it achievable in jquery to bind an event to a group of control that has certain class? It seems to me, it can't. I google a bit and all that came up are nothing to do with events. Here's how my code looks -

$('.numonly').bind('keypress',function(event){
    if (event.which > 31 && (event.which < 48 || event.which > 57)) return false;
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about binding