# How to add a custom button

You can also open a conversation in the widget directly from a button on the page. This can be done by creating a button with an onclick attribute and some Javascript. A live example can be found [here](https://jsfiddle.net/Botsquad/gjpfL5va/)

```markup
<button type="button" onclick="BotSqd.openConversation('main')">Open conversation</button>
```

Alternatively you can also use a link instead of a button by setting the onclick handler similar to the example above:

```markup
<a href="#" onclick="BotSqd.openConversation('main')">Open conversation</a>
```


---

# 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://manuals.dialox.ai/advanced-topics/bubblescript/how-to-add-a-custom-button.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.
