title: How would I create a button with an id in javascript
body: <p>I was wondering how I would go about adding id's to buttons that I'[m creating in javascript. I am pretty much pulling whatever results match what I'm looking for from parse, and displaying it in an un-ordered list. Im bulding an invitation system so i have also created an accept button underneath. How do I go about associating the accept button with that specific object that was pulled?
  Here is my code:</p>
  
  <pre><code>    function checkInvites(){
        var invite = Parse.Object.extend("sessions");
        var query = new Parse.Query(invite);
        query.equalTo("user", "bubbba");
        query.find({
          success: function(results) {
            console.log("Successfully retrieved " + results.length + " scores.");
             // Do something with the returned Parse.Object values
             for (var i = 0; i &lt; results.length; i++) {
              var object = results[i];
              var items = document.getElementById("invites");
              var item = document.createElement("li");
              item.innerHTML = object.get('user')+' '+ object.id;
              items.appendChild(item);
              var btn = document.createElement("BUTTON");        // Create a &lt;button&gt; element
              var t = document.createTextNode("accept");       // Create a text node
              btn.appendChild(t);         // Append the text to &lt;button&gt;
              items.appendChild(btn);
            }
          },
          error: function(error) {
            alert("Error: " + error.code + " " + error.message);
          }
        });
      }
  </code></pre>