Daniel Calderon Mori
Daniel Calderon Mori

Reputation: 5776

How can i access a element in a jquery object?

I have a basic jQuery question. I get an jquery object from a string:

var o = $(html_in_string)

Inside this jquery object, there is an element i want to have access to. How can i achieve that if i have the id of that element?

Upvotes: 1

Views: 84

Answers (1)

Anders Abel
Anders Abel

Reputation: 69260

If I understand you correctly, html_in_string is a string containing html. In that case you can use find().

var o = $(html_in_string).find("#some-id")

Upvotes: 2

Related Questions