arya2004/cmt-autofill

Add a "Clear All" Feature

オープン

#14 opened on 2025/10/02

 (4 件のコメント) (0 件のリアクション) (3 人の担当者)JavaScript (11 件のフォーク)auto 404
good first issuehacktoberfesthacktoberfest-acceptedhtmljavascript

Repository metrics

Stars
 (6 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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:

  1. Add a button to the popup:

    <button type="button" id="clearAllBtn">Clear All</button>
    
  2. 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
    }
    

コントリビューターガイド