Help me with this
function applyFormatting(style) { const selection = window.getSelection(); if (selection.toString().trim() !== '') { document.execCommand(style, false, null); } } boldBtn.addEventListener('click', () => applyFormatting('bold')); italicBtn.addEventListener('click', () => applyFormatting('italic')); underlineBtn.addEventListener('click', () => applyFormatting('underline')); fontSelect.addEventListener('change', () => { const font = fontSelect.value; editor.style.fontFamily = font; }); fontSizeInput.addEventListener('change', () => { const fontSize = fontSizeInput.value + 'px'; editor.style.fontSize = fontSize; }); colorPicker.addEventListener('change', () => { const color = colorPicker.value; editor.style.color = color; });