Are you sure you get the object in the first version? I only get [<embed>​,<div>​</div>​], as I would expect because of .children().
–
user113716Feb 12 '11 at 23:54

yes i get object in the array, because of andSelf(). Array looks like [object, embed, div]
–
HusseinFeb 12 '11 at 23:57

Strange. Because of your .children() inclusion, you should only be getting the children of [object, embed, div]. Since object is the only one with children, that would give you [embed, div].
–
user113716Feb 12 '11 at 23:59

I'm doing this in console. Textarea field is initially empty. I'm pasting the code inside it then issue jquery command in console. I'm not able to get it to work for iframe unless iframe is wrapped with another tag
–
HusseinFeb 13 '11 at 0:02

@patrick Actually having a second look at this, i'm not able to get the object tag, i was able to get it in this example because it's wrapped with a div tag. What's the solution to get all tags including the parent. Since iframe i not wrapper with another tag, it's giving an error
–
HusseinFeb 13 '11 at 0:10