good first issuehacktoberfesthacktoberfest-acceptedhtmljavascript
倉庫指標
- 星標
- (6 顆星)
- PR 合併指標
- (PR 指標待抓取)
描述
A "Clear All" button should let the user reset the form, removing all author entries at once.
Files to modify: popup.html, popup.js
How to do it:
-
Add a button to the popup:
<button type="button" id="clearAllBtn">Clear All</button> -
In
popup.js:document.getElementById('clearAllBtn').addEventListener('click', clearAllForms); function clearAllForms() { const container = document.getElementById('authorsContainer'); while (container.firstChild) { container.removeChild(container.firstChild); } addAuthorForm(); // Optionally, re-add a single blank form }