// --- Directions
// Part 1
// Write a function that accepts a string. The function should
// capitalize the first letter of each word in the string then
// return the capitalized string.
// --- Examples
// capitalize('a short sentence') --> 'A Short Sentence'
// capitalize('a lazy fox') --> 'A Lazy Fox'
// capitalize('look, it is working!') --> 'Look, It Is Working!'
// Part 2
// Then create the corresponding HTML that would make the code below function as follows
// As a user when I go to the html page i see an input field marked ENTER WORD TO CAPITALIZE
// When a user enters a word to capitalize and then clicks the CAPITALIZE button
// The field below prints out the CAPITALIZED Word in the browser
// Part 3
// Style this with CSS using Flexbox
const capitalize = (str) => {
// code here
}
// Input field
const inputEl = document.getElementById('text-field')
// Show Answer Button
const btnEl = document.getElementById('capatalize-button')
// Answer Display
const displayEl = document.getElementById('display-answer')
btnEl.addEventListener('click', (evt) => {
displayEl.innerHTML = capitalize(inputEl.value)
inputEl.value = ''
})