Hi All,

I want to refactor (port) the following PrototypeJS code to jQuery.
I'm in the process of learning jQuery and currently stuck with porting
this piece of code... Any idea's?

[code]
var total = 0;

// For each fieldpair that has a child with a checked input
// we get the sibling with a text input and add that value
// to the total.
$$(".fieldpair").each(function(fieldpair) {
   if (fieldpair.down("input:checked")) {
     var input = fieldpair.down('input:text');
     total += parseInt(input.value);
  }
});
[/code]

Reply via email to