title: Setting new value for an attribute using jQuery
body: <p>I am trying to set a new vale of a custom attribute of a div using <a href="http://api.jquery.com/attr/" rel="noreferrer"><code>attr()</code></a>. I found out it can be done using <code>.attr( attributeName, value )</code>, but when I try it it's not working.</p>
  
  <p>Here is the part of my code I am interested in:</p>
  
  <pre class="lang-js prettyprint-override"><code>$('#amount').attr( 'datamin','1000')
  </code></pre>
  
  <p>and the <em>div</em> that has the custom attribute is </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="amount" datamin=""&gt;&lt;/div&gt;
  </code></pre>
  
  <p><br>
  Here is the whole example:</p>
  
  <pre class="lang-js prettyprint-override"><code>$(function() {
      $( "#slider-range" ).slider({
          range: true,
          min: &lt;?php echo $min_val;?&gt;,
          max: &lt;?php echo $max_val;?&gt;,
          values: [ &lt;?php echo $min_val;?&gt;, &lt;?php echo $max_val;?&gt; ],
          slide: function( event, ui ) {
              $( "#amount" ).html( "&lt;?php echo $currency_chk_i;?&gt;" + ui.values[ 0 ] + " - &lt;?php echo $currency_chk_i;?&gt;" + ui.values[ 1 ] );
  
              $('#amount').attr( 'datamin','1000');
  
          },
          change: function(event, ui) {
              // when the user change the slider
          },
          stop: function(event, ui) {
          alert(ui.values[0]);
              // when the user stopped changing the slider
  
          }
      });
      $( "#amount" ).html( "&lt;?php echo $currency_chk_i;?&gt;" + $( "#slider-range" ).slider( "values", 0 ) +
          " - &lt;?php echo $currency_chk_i;?&gt;" + $( "#slider-range" ).slider( "values", 1 ) );
  
  });
  </code></pre>
  
  <p><br>
  Can anyone point out where I am wrong or any other way out?</p>