Today I learned how to create a simple random choice picker. A user types in multiple choices separated by a comma and the application randomly selects one of the choice. This project taught me
function createTags(input){
const tags = input.split(',')
.filter(tag => tag.trim()!== '')
.map(tag => tag.trim())
tagsEl.innerHTML = '';
tags.forEach(tag => {
const tagEl = document.createElement('span');
tagEl.classList.add('tag');
tagEl.innerText = tag;
tagsEl.appendChild(tagEl);
})
}
Category | HTML / JS / CSS |
Credits | 50 Projects in 50 days |
Date | January 30th, 2025 |
Codepen | Click here |