Alertnatively just for your reference these are also some ways to get what you desire : $('form').each(function(){ $(this).children('input').each(function(){ alert(this.name); alert($(this).val()); }) });
Thanks & Regards, Dhruva Sagar. Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html> - "I'm willing to admit that I may not always be right, but I am never wrong." On Wed, Sep 16, 2009 at 3:26 PM, pritisolanki <pritiatw...@gmail.com> wrote: > > Hi All, > > I tried > > $("form").each(function() { > alert(this.name); > alert($("input").val()); > }); > > in following HTML > > <form id="form" name="form1"> > Form 1 > <input name="foo" value="XXX" /> > </form> > > <form id="form" name="form2"> > Form 2 > <input name="blr" value="YYY" /> > </form> > > <form id="form" name="form3"> > Form 3 > <input type="checkbox" /> > <input type="checkbox" checked="checked" /> > </form> > > it only alert "XXX" nothing else !!! any idea about this. My journey > till now is difficult in jquery :-( .Hope to see some answers tomorrow. >