class Note extends HTMLElement { connectedCallback() { // Get the note content const content = this.innerHTML; // Get optional type attribute for different note styles const type = this.getAttribute('type') || 'default'; // Get optional title attribute const title = this.getAttribute('title'); // Build the note HTML let noteHTML = '
'; // Add title if provided if (title) { noteHTML += `

${title}

`; } // Add the content noteHTML += content; noteHTML += '
'; this.innerHTML = noteHTML; } } customElements.define('note-box', Note);