title: Get data value and apply a class if it equals a certain value
body: <p>I have a homework assignment that requires the use of gridster.js and I want to be able to check if a list item's data-row attribute equals a certain value and its data-col attribute equals a value. If they do equal the desired value and their coordinates match the intended position I would like to add a class to that list item of "true." </p>
  
  <p>The list item I'm currently trying to achieve this with has an initial <code>data-row</code> of <code>2</code> and a <code>data-col</code> of <code>1</code> and I want to check if it has been moved to <code>data-row</code> <code>1</code> and <code>data-col</code> <code>1</code>. The code I've tried is this: </p>
  
  <pre><code>if ($('.hi').data({row: 1, col: 1})) $('.hi').addClass('true'); }
  </code></pre>
  
  <p>However, this statement results in the class of true being added regardless of position. Ideally what I'm trying to do is check if the <code>data-row</code> and <code>data-col</code> values for each list item equals the correct values and if they do add the class of true. Then, I am planning on using the <code>.each</code> method to check if each list item has a class of <code>true</code> and if they do, I would like to change the background color of the div that contains the gridster unordered list. </p>