views:

146

answers:

2

Hi,

This code is based on prototype and returns all the input elements that are inside span tags that have .myClass as the class attribute so I can iterate each one.
What will be the syntax for JQuery?

 $$('span.myClass input').each(function(element) {alert(element)});
A: 
$.each($('span.myClass input'), function(element) {alert(element)});

Note: not tested.

JimNeath
+3  A: 
 $('span.myClass input').each(function() {alert(this)});
Craig Stuntz