title: How to change the attribute value of an input using jquery
body: <p>I have following html structure and want to change the value of price attribute when another input is filled.</p>
  
  <pre><code>&lt;dd&gt;
      &lt;div class="input-box additional-images imprint-images" style="height: 400px; padding-bottom: 0px; outline: medium none; overflow: hidden; width: 889px; padding-right: 0px;" tabindex="0"&gt;
          &lt;ul id="options-788-list" class="options-list"&gt;
              &lt;li&gt;
                  &lt;input type="checkbox" price="0" value="9697" id="options_788_2" name="options[788][]" onclick="opConfig.reloadPrice()" class="checkbox  product-custom-option"&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
  &lt;/dd&gt;
      &lt;div class="color-quantity not-selected-inputs"&gt;
          &lt;input type="text" name="custom" onkeydown="return myFunction(event);"&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I have tried to change price attribute by using following script but not works:</p>
  
  <pre><code>var quantitys = 0;
  jQuery(".color-quantity &gt; input").each(function() {
      if (this.value) {
          quantitys += (this.value) * 1;
      }
  
      if (parseInt(quantitys) &gt;= "25") {
          alert("more than 25");
          jQuery("dd &gt; .imprint-images  &gt; ul &gt; li &gt; input").attr("price", "5.00");
      }
  });
  </code></pre>
  
  <p>Please help me in this case.</p>