Iterate through jQuery objects with each()
I always forget how to do break out of the each() method when iterating through a jQuery object.
<script type="text/javascript">
/* <![CDATA[ */
$('#rates-frm').submit(function(){
var bValid = true;
$('#rates-frm input[@type="text"]‘).each(function(i, o){
alert(’index: ‘ + i + ‘ object id: ‘ + o.id);
if (i > 5) {
return false;
}
});
});
/* ]]> */
</script>