# Set the context menu by element type

You can configure context menus to open only when specific types of elements are clicked. Instead of applying the menu to the entire page or window, you can provide a **selector** that targets certain elements.

This allows you to create context menus that are specific to certain UI components, such as images, file items, or custom interface elements.

<figure><img src="/files/Y5sGQHmB3aMj5TdhH2VY" alt=""><figcaption></figcaption></figure>


---

# 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://deskifier.gitbook.io/deskifier/deskifier-bubble.io-docs/guides-and-examples/set-the-context-menu-by-element-type.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.
