Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solution() {
- const employeeInput = document.getElementById('employee');
- const categoryInput = document.getElementById('category');
- const urgencyInput = document.getElementById('urgency');
- const teamInput = document.getElementById('team');
- const descriptionInput = document.getElementById('description');
- const addButton = document.getElementById('add-btn');
- const editButton = document.getElementById('edit-btn');
- const continueButton = document.getElementById('continue-btn');
- const previewList = document.querySelector('.preview-list');
- addButton.addEventListener('click', () => {
- const employee = employeeInput.value.trim();
- const category = categoryInput.value.trim();
- const urgency = urgencyInput.value.trim();
- const team = teamInput.value.trim();
- const description = descriptionInput.value.trim();
- if (employee === '' || category === '' || urgency === '' || team === '' || description === '') {
- return;
- }
- const listItem = document.createElement('li');
- listItem.innerHTML = `
- <span>${employee}</span>
- <span>${category}</span>
- <span>${urgency}</span>
- <span>${team}</span>
- <span>${description}</span>
- <button class="edit-btn">Edit</button>
- <button class="continue-btn">Continue</button>
- `;
- previewList.appendChild(listItem);
- employeeInput.value = '';
- categoryInput.value = '';
- urgencyInput.value = '';
- teamInput.value = '';
- descriptionInput.value = '';
- addButton.disabled = true;
- editButton.disabled = false;
- continueButton.disabled = false;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment