# Draggable & Editable List
A minimal JavaScript project for creating and managing a draggable and editable list.
---
## HTML Basics
### `<ul>` and `<li>`
- **`<ul>`**: Unordered List. Creates a bullet-point list.
- **`<li>`**: List Item. Each item in a `<ul>` or `<ol>` is wrapped in `<li>`.
**Example:**
```html
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Orange</li>
</ul><ol>: Ordered List. Creates a numbered list.<li>: List Item. Each item in a<ol>is wrapped in<li>.
Example:
<ol>
<li>First</li>
<li>Second</li>
<li>Third</li>
</ol>- Drag and Drop is a user interface feature that allows users to click and hold an object, drag it to a new location, and release it to "drop" it there.
- In this project, it means users can reorder list items by dragging them up or down.
- JavaScript (JS) is a programming language used to make web pages interactive.
- It runs in the browser and can change HTML, CSS, and respond to user actions (like clicks, drags, etc.).
- Add new items using the input field.
- Drag items to reorder.
- Double-click an item to edit it.
- Click the delete button to remove an item.
Here’s a simple example using jQuery UI to make a list draggable:
HTML:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>
<body>
<ul id="sortable">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<script>
$(function() {
$("#sortable").sortable();
$("#sortable").disableSelection();
});
</script>
</body>
</html>How it works:
- The list items can be dragged and reordered.
- jQuery UI’s
sortable()function makes the list draggable.
- HTML5
- CSS3
- Vanilla JavaScript
- jQuery UI (optional)
Allowd to Imporve this Educational Code.