title: Safe way to store data for button clicks
body: <p>I am trying to find out what the safest way to store data for use when the user clicks on a button. </p>
  
  <p>I know that you can store data in attributes(either the value attribute or a data- attribute) of the button tag like so:</p>
  
  <pre><code>&lt;button type="button" value="1" data-value="1"&gt;Click me!&lt;/button&gt;
  </code></pre>
  
  <p>But the problem with this is that the user(probably really only advanced users) can manipulate the value with firebug or some other app and THEN click the button and send over different data. I fully understand that I need to check the input before I try to do anything with the sent data.</p>
  
  <p>I also found out that I could use jQuery's <code>.data()</code> to attach data to dom elements, which seems a bit more useful. I'm not exactly sure how the data is stored, but I assume its harder to manipulate.</p>
  
  <p>What got me really interested in this question was when I was looking through <strong>Soundcloud's</strong> code in firebug, I saw that none of the "like" buttons had data attached to the buttons. I tried deleting/manipulating elements/data and the buttons still worked. So it got me thinking that they are probably using a similar process to what jquerys data() is doing.</p>
  
  <p><strong>I just want to know if there is a safer way to store data or a way so that the user can't manipulate the data before clicking the button.</strong></p>