$('#ObjectMaster #FirstName') should give you almost the exact same performance of $('#ObjectMaster').find('#FirstName'), as the exact same is happening internally. There is the option of using a context:
$('#FirstName', ObjectMaster) but I'm not sure that would give you any performance increase. Most important, as Mike has pointed out, IDs are meant to be unique. You'll certainly run into other problems this way, use classes instead. On Jan 2, 12:32 am, Maya <kfo...@gmail.com> wrote: > Hi guys, here is my case: > > I have a JQuery object named ObjectMaster representing html contents, > inside this object there is a TD with id=FirstName that I want to > populate its text, is there a way to reach FirstName tag from its > parent (ObjectMaster) WITHOUT using: > > $(ObjectMaster).find('#FirstName').text("new text") > > Someone might say why not populating FirstName directly? I can't do > that since I have other "ObjectMaster"s containing identical TD with > the same FirstName id, so I have to reach each TD through its parent, > otherwise I would be populating the wrong TD's. > > The problem with the Find function is that its remarkably slow when > populating hundreds of TD's so I'm trying to do something like: > > $(ObjectMaster +' '+ '#FirstName').text('new text') > Or > $('#'+ObjectMaster.id +' '+ '#FirstName').text('new text') > > But its not working. > > So mainly my problem is trying to use a combined selector of an object > and a child tag name. > > Is this doable? If not, is there any lightweight solution to this > scenario? > > Many thanks and appreciate your help. > > Maya.