Add delete to GPT4
Thu Sep 07 2023 14:33:38 GMT+0000 (Coordinated Universal Time)
Saved by
@harshvasu
#javascript
// Add delete buttons below div.markdown elements
const markdownDivs = document.querySelectorAll('.group');
markdownDivs.forEach((div, index) => {
const deleteButton = document.createElement('button');
deleteButton.textContent = 'Delete';
deleteButton.classList.add('delete-button');
deleteButton.addEventListener('click', () => {
// Remove the corresponding div when the delete button is clicked
div.remove();
});
// Append the delete button to the div
div.appendChild(deleteButton);
});
content_copyCOPY
https://chat.openai.com/?model
Comments