> For the complete documentation index, see [llms.txt](https://jscula.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jscula.gitbook.io/docs/manipulation/.tolast.md).

# .toLast()

A Jscula method that moves an HTML element to the last position among its siblings in the parent element.

The <mark style="color:purple;">**`toLast()`**</mark> function moves a specified HTML element to the last position among its sibling elements within the same parent.

#### Usage

```javascript
$('selector').toLast();
```

* **selector**: The element to be moved.

#### Example

Move the 1st list item to the end of its list:

```javascript
$('ul li:nth-first').toLast();
```

#### Use cases

Use `toLast()` to:

* Move completed tasks below active tasks.
* Send a dismissed notification to the end of its list.
* Place a low-priority card after other cards.

#### More examples

Move the completed task to the end of the task list:

```javascript
$('.task.completed').toLast();
```

Move a dismissed notification to the end of the notification panel:

```javascript
$('.notification.dismissed').toLast();
```

Move the first featured card after the remaining cards:

```javascript
$('.card.featured:nth-first').toLast();
```

#### Returns

* The moved element.

#### Description

By calling `toLast()` on an element, the element is relocated to the end of its parent container, maintaining the DOM hierarchy smoothly.
