document.addEventListener('DOMContentLoaded', function () {
    // Find the select box and the reply text area
    var responseSelect = document.getElementById('ts_canned_response_select');
    var replyBox = document.querySelector('textarea[name="comment_content"]');

    if (responseSelect && replyBox) {
        responseSelect.addEventListener('change', function () {
            // Get the content from the selected option's 'data-content' attribute
            var content = this.options[this.selectedIndex].getAttribute('data-content');

            if (content) {
                // Insert the content into the text area
                replyBox.value = content;

                // Reset the select box
              //  this.selectedIndex = 0;
            }
        });
    }
});