Intern 2
Intern 2
Overview
This internship notebook documents a structured 30-day plan for a beginner
student in frontend development. Each day includes activities, learnings, and a
detailed explanation of one day's experience.
addTaskButton.addEventListener('click', function() {
const taskText = taskInput.value;
if (taskText) {
const listItem = document.createElement('li');
listItem.textContent = taskText;
taskList.appendChild(listItem);
taskInput.value = ''; // Clear the input field
}
});
3. Testing the Functionality: After implementing the code, I tested the
functionality by adding several tasks. Each time I clicked the "Add Task"
button, the input value was added to the list. I made sure to clear the input
field after adding the task, which enhanced user experience.
4. Adding Styles: To make the to-do list visually appealing, I added some
CSS to style the input field, button, and list items. I learned about the box
model and how padding and margins affect layout.
css
Kodu kopyala
#taskInput {
margin: 10px 0;
padding: 10px;
width: 200px;
}
#addTaskButton {
padding: 10px;
}
#taskList {
list-style-type: none;
}
#taskList li {
margin: 5px 0;
padding: 5px;
border: 1px solid #ccc;
}
Reflection:
By the end of Day 12, I felt a sense of accomplishment. I had successfully created
an interactive feature that utilized key JavaScript concepts. This experience
solidified my understanding of how the DOM works and the practical application
of JavaScript in making web pages dynamic. I was excited to continue building
more complex projects in the following days.