When try to refine a jquery set with last elements using the function gt() it just not work.
Here is an example, it was tested in firefox 3.5 and jquery 1.3.2. I had placed 3 empty fields, with jQuery I asign an "x" value for all of them. Then I try to asign a "y" for the last two fields using the gt() function, but it doesn't work. (Note: to test it by you copy and paste the code in an html file, you need to have the jquery-1.3.2.js in the same folder) <code><pre> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jQuery gt() function problem</title> <script type="text/javascript" src="jquery-1.3.2.js"></script> <script type="text/javascript"> jQuery(document).ready(function($) { $('.field').val('x'); //assign value for all $('.field').gt(0).val('y'); //assing value for fields 2 and 3 }) </script> </head> <body> 1<input type="text" class="field" /> 2<input type="text" class="field" /> 3<input type="text" class="field" /> </body> </html> </pre></code> Any one can explain me what is happend? ...this is a bug or I missed something? thanks Julio Cesar