title: Does not delete document from firebase when click on button (onclick method)
body: <blockquote>
    <p>Does not delete stored document in cloud-firestore.</p>
  </blockquote>
  
  <p>When i run my program 5 buttons are show (because my firestore documents are 5) and when i click button then show error <em>test.html:1 Uncaught ReferenceError: ds5678fhiksnie is not defined
      at HTMLButtonElement.onclick (test.html:1)</em>
  <strong>I want to 
   when button is clicked then id according document is deleted.</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
      &lt;!-- parent named class inner buttons according document stored in cloud-firestore--&gt;
      &lt;div class="parent"&gt;&lt;/div&gt;
      &lt;-- api --&gt;
      &lt;script src="https://www.gstatic.com/firebasejs/4.9.0/firebase.js"&gt;&lt;/script&gt;
  
      &lt;script
          src="https://www.gstatic.com/firebasejs/4.9.0/firebase-firestore.js"&gt;&lt;/script&gt;
  
  
      &lt;script&gt;
  // web setup this is sample
          firebase.initializeApp({
           apiKey: '### FIREBASE API KEY ###',
           authDomain: '### FIREBASE AUTH DOMAIN ###',
           projectId: '### CLOUD FIRESTORE PROJECT ID ###'
  });
  firebase.initializeApp(config);
  &lt;/script&gt;
      &lt;script&gt;
          var db = firebase.firestore();
          // inserting one record automatic id
          db.collection("users").add({
              first: "Ada",
              last: "Lovelace",
              born: 2000
          })
          .then(function(docRef) {
              console.log("Document written with ID: ", docRef.id);
          })
          .catch(function(error) {
              console.error("Error adding document: ", error);
          });
  
          // get element
          var p =document.querySelector(".parent");
         // display the document
          db.collection("users").get().then(function(querySnapshot) {
              querySnapshot.forEach(function(doc) {
                  var d=String(doc.id);
                  console.log(d);
                  // if stored documents are 5 then 5 buttons will display 
                  p.innerHTML+="&lt;button onclick=delet("+String(d)+")&gt;Hello&lt;/button&gt;";
              });
          });
  
           // delete function(id passing)
          function delet(v) {
          console.log(v);
          db.collection("users").doc(v).delete().then(function() {
              console.log("Document successfully deleted!");
          }).catch(function(error) {
              console.error("Error removing document: ", error);
          });
          }
  
          &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>