-button Class --btn | Btn-xs Btn-default Quote-post-- Data-posted By --jessdavo-- Data-target --post-form-- =link=

data-target="post-form" : Tells the browser which part of the page—usually the reply text area—should receive the quoted text once the button is clicked. How the Quote Feature Works

JavaScript listens for clicks on .quote-post buttons.

Allow users to highlight a portion of the post and quote only that: data-target="post-form" : Tells the browser which part of

); );

The Art of the Pivot: Why I’m Refocusing on Lifestyle & Entertainment .quote-post cursor: pointer

<div class="post" id="post-123"> <div class="post-author">Jessdavo</div> <div class="post-content"> This is an example post that someone might want to quote. </div> <button class="btn btn-xs btn-default quote-post" data-posted-by="Jessdavo" data-target="reply-form"> Quote </button> </div>

.quote-post cursor: pointer;

document.querySelectorAll('.quote-post').forEach(btn => btn.addEventListener('click', (e) => const author = btn.dataset.postedBy; // "Jessdavo" const targetId = btn.dataset.target; // "post-form" const originalMessageElement = btn.closest('.post').querySelector('.post-content'); const originalText = originalMessageElement.innerText; buildQuote(author, originalText, targetId);