HTMLIFrameElement: browsingTopics property
HTML DOM
HTML DOM
> [!WARNING]
> This feature is currently opposed by two browser vendors. See the [Standards positions](/docs/Web/API/Topics_API#standards_positions) section for details of opposition.
The **`browsingTopics`** property of the HTMLIFrameElement interface is a boolean specifying that the selected topics for the current user should be sent with the request for the associated iframe's source in a Sec-Browsing-Topics header. This reflects the `browsingtopics` HTML attribute.
## Value
A boolean. The default value is `false`; set it to `true` to send the associated `<iframe>` source request with a Sec-Browsing-Topics header containing the selected topics for the current user.
## Examples
### Get
Set `browsingtopics` to `true` then load the `<iframe>` contents declaratively:
```html
<iframe browsingtopics title="Advertising container" src="ad-tech1.example">
...
</iframe>
```
Log the `browsingTopics` value via script:
```js
const iframeElem = document.querySelector("iframe");
console.log(iframeElem.browsingTopics); // will return true in supporting browsers
```
### Set
Specify a minimum `<iframe>`:
```html
<iframe> ... </iframe>
```
Set `browsingtopics` to `true` then load the `<iframe>` contents via script:
```js
const iframeElem = document.querySelector("iframe");
iframeElem.browsingTopics = true;
iframeElem.title = "Advertising container";
iframeElem.src = "ad-tech1.example";
```
## Specifications
This feature is not part of an official standard, although it is specified in the [Topics API Unofficial Proposal Draft](https://patcg-individual-drafts.github.io/topics/).
## Browser compatibility
## See also
- [Topics API](/docs/Web/API/Topics_API)
Cite this
"HTMLIFrameElement: browsingTopics property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/browsingTopics JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy