title: return an object that show which element was clicked
body: <p><strong>EDIT</strong> the fact that I use closures and function is important. like the <code>gatherData()</code> and <code>voteSection()</code></p>
  
  <p>I want to click a div called <code>submitButton</code> this should tell me what the users have done. I have 3 sections. A voting section, a review section, and another type of voting section. the point is that right now I'm trying to set up the first voting section. When I click the <code>submitButton</code> I should get a an object that looks like <code>{vote:down}</code> or <code>{vote:up}</code> I only have two buttons in the voting section.</p>
  
  <pre><code>function gatherData(){
      var submitButton = ".submitButton";
      var result = {}
      function voteSection(){
          $(".upButton").click(function(){
              // result.vote = "up"
              //  console.log(result) ;
              $(this).data("clicked", true);
              $(this).siblings(".downButton").data("clicked",false)
          })
          $(".downButton").click(function(){
              $(this).data("clicked", true);
              $(this).siblings(".upButton").data("clicked",false)
              // result.vote = "down";
              //  console.log(result) ;
          })
      //    return result;
      }
      $(submitButton).on("click",function(){
          if($(".upButton").data("clicked")){
              result.vote = "up"
          }else if($(".downButton").data("clicked")){
              result.vote = "down";
          }
      })
      return result;
  }
  $(".submitButton").on("click",function(){
      console.log(gatherData())
  })
  </code></pre>
  
  <p>Thanks for any help</p>
  
  <p>EDIT
  I realized I forgot to call <code>voteSection</code></p>
  
  <p>here's what I have now. it return an empty object</p>
  
  <pre><code>function gatherData(){
      var submitButton = ".submitButton";
      var result = {}
      function voteSection(){
          $(".upButton").click(function(){
              // result.vote = "up"
              //  console.log(result) ;
              $(this).data("clicked", true);
              $(this).siblings(".downButton").data("clicked",false)
          })
          $(".downButton").click(function(){
              $(this).data("clicked", true);
              $(this).siblings(".upButton").data("clicked",false)
              // result.vote = "down";
              //  console.log(result) ;
          })
          if($(".upButton").data("clicked")){
              result.vote = "up"
          }else if($(".downButton").data("clicked")){
              result.vote = "down";
          }
          // })
          return result;
      //    return result;
      }
     return voteSection()
      // $(submitButton).on("click",function(){
  
  }
  $(".submitButton").on("click",function(){
      console.log(gatherData())
  })
  </code></pre>