title: Jquery data attribute value equals
body: <p>Below are my requirements.. i tried in below way. it doesnt work for me. Please let me know what is missed out. Thanks</p>
  
  <ol>
  <li>if data-block = 1, add data-rewardpoints = 300</li>
  <li>if data-block = 2, add data-rewardpoints = 400</li>
  <li>if data-block = 3, add data-rewardpoints = 500</li>
  </ol>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div class="ir_image_holder"&gt;
    &lt;img class="ir_img_src" src="1.jpg" data-block="1" data-rewardpoints="" /&gt;
  &lt;/div&gt;
  &lt;div class="ir_image_holder"&gt;
    &lt;img class="ir_img_src" src="2.jpg" data-block="2" data-rewardpoints="" /&gt;
  &lt;/div&gt;
  &lt;div class="ir_image_holder"&gt;
    &lt;img class="ir_img_src" src="3.jpg" data-block="3" data-rewardpoints="" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>if ($('.ir_image_holder .ir_img_src').data('block')===1) {
      $('.ir_image_holder .ir_img_src').attr('data-rewardpoints', '300');
  } else if ($('.ir_image_holder .ir_img_src').data('block')===2) {
      $('.ir_image_holder .ir_img_src').attr('data-rewardpoints', '400');
  } else if ($('.ir_image_holder .ir_img_src').data('block')===3) {
      $('.ir_image_holder .ir_img_src').attr('data-rewardpoints', '500');
  }
  </code></pre>