title: JQuery Mobile how to iterate through a list of elements and add their id's to a list
body: <p>I have a list of li tags in a unordered list. All the tags have a <code>class=listitem</code> and a <code>data-clicked=true/false</code> in them and I need to go through and write only the id's of the ones with <code>data-clicked=true</code> in them and add it to a string called <code>custidlist</code> and separate each item with commas. Here is what I have:</p>
  
  <pre><code>    $("#done").click(function() {
          var custidlist=""
          $(".listitem").each(function() {
          if ($(".listitem").data("clicked")==true) {
              custidlist=custidlist+$(".listitem").attr("id")+","
              alert(custidlist)
          }
      }); 
  </code></pre>
  
  <p>The alert is not showing up at all when the button is pressed. Any help would be greatly appreciated.</p>