NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

HTML:-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>To-Do List</title>
<link rel="stylesheet" href="Question1.css">
</head>
<body>
<div class="container">
<h1>To-Do List</h1>
<div class="input-container">
<input type="text" id="taskInput" placeholder="Add a new task...">
<button id="addTaskButton">Add</button>
</div>
<ul id="taskList">
<!-- Tasks will be added here dynamically -->
</ul>
</div>
<script src="Question1.js"></script>
</body>
</html>

JavaScript:-
// Get references to HTML elements
const taskInput = document.getElementById("taskInput");
const addTaskButton = document.getElementById("addTaskButton");
const taskList = document.getElementById("taskList");

// Event listener for adding a task
addTaskButton.addEventListener("click", addTask);

// Event listener for completing or removing a task
taskList.addEventListener("click", taskAction);

// Function to add a new task
function addTask() {
const taskText = taskInput.value.trim();
if (taskText !== "") {
const li = document.createElement("li");
li.innerHTML = `
<span>${taskText}</span>
<button class="complete-button">Complete</button>
<button class="remove-button">Remove</button>
`;
taskList.appendChild(li);
taskInput.value = "";
}
}

// Function to complete or remove a task
function taskAction(event) {
const target = event.target;
if (target.classList.contains("complete-button")) {
const taskItem = target.parentElement;
taskItem.classList.toggle("completed");
} else if (target.classList.contains("remove-button")) {
const taskItem = target.parentElement;
taskList.removeChild(taskItem);
}
}

CSS:-
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}

.container {
max-width: 400px;
margin: 20px auto;
background-color: #fff;
padding: 20px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
border-radius: 5px;
text-align: center;
}

h1 {
font-size: 24px;
}

.input-container {
margin-bottom: 20px;
}

input[type="text"] {
width: 70%;
padding: 8px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 5px;
margin-right: 10px;
}

button {
padding: 8px 16px;
font-size: 16px;
background-color: #5449b8;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}

ul {
list-style: none;
padding: 0;
}

li {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0;
border-bottom: 1px solid #ccc;
}

.completed {
text-decoration: line-through;
color: #888;
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.