Search This Blog

Thursday, October 7, 2010

Find an element Id which match a pattern in jquery

Using jquery its possible to find an element that matches a specific pattern. This code will find each input Id and check if its greater than 24

           $("input[id^=duration_]").each(function() {

                if($(this).val()>24){
                    alert('Duration should be less than 24');
                     returnValue = false;
                }

            });
more examples 

No comments: