jQuery: The Write Less, Do More JavaScript Library

 « Return to Thread: How 2 Find Control

Re: How 2 Find Control

by Cesar Sanz :: Rate this Message:

Reply to Author | View in Thread


Hello,  suppose this markup

<div id="div_id">
    <input type="text" name="text1" value="text1"/>
    <inptu type="text" name="text2" value="text2"/>
</div>

just do $("div#div_id input:text") to retrieve an array containing all the
inputs and you are done

then, if you want to iterate it do

$("div#div_id input:text").each(function(){
    window.alert($(this).val());
});

Regards
----- Original Message -----
From: "vipin" <vipinpaliwal1980@...>
To: "jQuery (English)" <jquery-en@...>
Sent: Thursday, July 02, 2009 10:22 PM
Subject: [jQuery] How 2 Find Control


>
> Hi all,
>
> I am new in jquery.I have one problem.in my project i have a <div> and
> in this div i have lots of textbox or input box (type :text). Can any
> body give me some code to find these control  and get there value.
>
> Thanks

 « Return to Thread: How 2 Find Control