# iFrame Target

Imagine we have an iframe (`#iframeFoo`) and need to query a sub-element within its scope. So we create a target for the iframe container:

![Defining iframe container target](https://3461068122-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdyKJ-zzeS2hB7DF04J%2F-LuI-pRW_ANo1ZFRnX6M%2F-LuI-t0DS86-J2hVVRNe%2Fiframe1.png?alt=media\&token=549f0382-9b47-41d9-8b3d-0b38ba985747)

Then  we create a target for the local element

![Defining local target](https://3461068122-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdyKJ-zzeS2hB7DF04J%2F-LuI-pRW_ANo1ZFRnX6M%2F-LuI-vfHZGcgQavR600e%2Fiframe2.png?alt=media\&token=55337d7a-42df-40e2-801c-361046a8f77a)

The first one is a simple target like we are used to have in Puppetry, but the second is chained one. While building it we expand Options, set **Parent target** to `IFRAME_FOO` and **Parent type** to `inline frame`.

![Chained target](https://3461068122-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdyKJ-zzeS2hB7DF04J%2F-LuI-pRW_ANo1ZFRnX6M%2F-LuI-zwgiE420RssQtvh%2Fiframe3.png?alt=media\&token=615f6432-fe2b-46de-95c3-1bba45a8d64e)

As soon as the local element target defined (`IFRAME_FOO_LOCAL`) we can address it as any simple target.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.puppetry.app/target/iframe-target.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
