# drag\_to\_element

## Syntax

```python
Element.drag_to_element(to_element)
```

## Usage

{% code title="correct usage" %}

```python
element = py.get('#drop-here')
py.get('#drag-this').drag_to_element(element)
```

{% endcode %}

{% code title="incorrect usage" %}

```python
# Errors, 'drag_to_element' takes an Element
py.get('#drag-this').drag_to_element('#drop-here')

# Use the .drag_to() command instead

---or---

# Errors, `drag_to_element` and `drag_to` are not part of the Pylenium object
element = py.get('#drop-here')
py.drag_to_element(element)
```

{% endcode %}

## Arguments

* `to_element(Element)` - The destination element to drag to.

## Yields

* **(Element)** The current element that was dragged.


---

# 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.pylenium.io/element-commands/actions/drag_to_element.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.
