A beginner-friendly project showcasing DOM manipulation with vanilla JavaScript! π
Features β’ Setup β’ Usage β’ Code Examples β’ Learning Points β’ Future Ideas
- β¨ Add movies to your watchlist instantly
- ποΈ Remove movies with one click
- π¨ Clean, responsive interface
- β‘ No page reloads - everything happens dynamically!
- HTML - For structuring the content
- CSS - For styling and animations
- JavaScript - For DOM manipulation and interactivity
<div id="movie-list">
<ul>
<!-- Movies get added here dynamically -->
</ul>
</div>
.delete {
float: right;
background: red;
padding: 6px;
border-radius: 4px;
cursor: pointer;
color: white;
}
- Clone the repository:
git clone https://github.com/Suniksha12/movie-list-manager.git
- Navigate to project directory:
cd movie-list-manager
- Open
index.html
in your browser:
# For macOS
open index.html
# For Windows
start index.html
- Type movie name in input box
- Click "Add" or press Enter
- Movie instantly appears in list
- Click the red "delete" button next to movie
- Movie is instantly removed
addForm.addEventListener('submit', function(e) {
e.preventDefault(); // Stop the form from refreshing
// Get movie name from input
const value = addForm.querySelector('input[type="text"]').value;
// Create new elements
const li = document.createElement('li');
const movieName = document.createElement('span');
const deleteBtn = document.createElement('span');
// Add the movie
movieName.textContent = value;
deleteBtn.textContent = 'delete';
// Put it all together
li.appendChild(movieName);
li.appendChild(deleteBtn);
list.appendChild(li);
});
- Creating elements dynamically
- Removing elements from page
- Updating content without reloads
- Form submission events
- Click events
- Preventing default behaviors
- Clean code structure
- Readable formatting
- Effective commenting
- Local storage persistence
- Movie ratings system
- Sorting functionality
- Movie categories
- Search feature
- Real-time DOM updates
- No database required
- Smooth animations
- User-friendly interface
- Professional animations
- Fully responsive layout
Feel free to use this project as a learning resource! If you have any improvements:
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is open source and available under the MIT License.
Happy Coding! π