Link to home
Start Free TrialLog in
Avatar of Brad Bansner
Brad Bansner

asked on

get values of text boxes, by class, within a DIV where I know ID of DIV

I have text boxes like this:

<input type="text" class="organization" size="32">

They are buried a few levels down beneath a DIV, such as:

<div id="abc">

</div>

In my script, I know the ID of the DIV. I need to get what is typed into the text box by class. There will be only one "organization" class within each DIV.

The text box is not a direct child of the DIV, which is where I'm getting a little confused.

Thank you!
ASKER CERTIFIED SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Check the below links hope it helps

http://stackoverflow.com/questions/4088467/jquery-get-value-in-input-text-box
http://api.jquery.com/val/

or try

$('.organization').keyup(function(e) {
  var $input = $(this);
    var value = $input.val();
  });

Open in new window

hope it helps.
Avatar of Brad Bansner
Brad Bansner

ASKER

That worked, with the exception that I just needed to add val() to the end. Thanks!