Roy
Roy

Reputation: 2323

select a child element in jquery object

I'm new to jquery and I have a basic question now.

I have a jquery object got from a jquery selector. e.g

var obj = $('#certainTR');

Now, I want to get the element in this object and I cannot use '#certainTR > date' in a selector because '#certain' is not passed in my subroutine. Is there anyway to make a selection base on a object? Thanks a lot in advance!

Upvotes: 7

Views: 7507

Answers (1)

Reigel Gallarde
Reigel Gallarde

Reputation: 65284

use .children()

var obj = $('#certainTR'); // #certainTR
obj.children('.date'); // #certainTR > .date

I suggest you should visit Tree Traversal

Upvotes: 12

Related Questions