title: How to Pixel Reduction By Attribute "0" in Jquery
body: <p>I want, if item which has class <code>.card-product-new-tag</code> has attribute <code>show-value</code> is equal to <code>0</code> and at the same time if item which has class <code>.card-product-sale-tag</code> has attribute <code>show-value</code> is equal to <code>1</code> then change css of item which has class <code>.card-product-sale-tag</code> from <code>top: -35px</code> to <code>top: 10px</code>.</p>
  <p>So, shortly, I want to see red tag at the top, like yellow tag, if there is no yellow tag.</p>
  <p>HTML:</p>
  <pre><code>&lt;div class=&quot;card-product&quot;&gt;
      &lt;img class=&quot;card-product-img&quot; src=&quot;https://via.placeholder.com/1200x1440&quot;&gt;
      &lt;img class=&quot;card-product-img2&quot; src=&quot;https://via.placeholder.com/1201x1441&quot;&gt;
      &lt;div class=&quot;card-tag card-product-new-tag&quot; show-value=&quot;1&quot;&gt;YENİ&lt;/div&gt;
      &lt;div class=&quot;card-tag card-product-sale-tag&quot; show-value=&quot;0&quot;&gt;İNDİRİM&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class=&quot;card-product&quot;&gt;
       &lt;img class=&quot;card-product-img&quot; src=&quot;https://via.placeholder.com/1200x1440&quot;&gt;
       &lt;img class=&quot;card-product-img2&quot; src=&quot;https://via.placeholder.com/1201x1441&quot;&gt;
       &lt;div class=&quot;card-tag card-product-new-tag&quot; show-value=&quot;0&quot;&gt;YENİ&lt;/div&gt;
       &lt;div class=&quot;card-tag card-product-sale-tag&quot; show-value=&quot;1&quot;&gt;İNDİRİM&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>CSS:</p>
  <pre><code>.card-product-new-tag {
      top: 10px;
  }
  
  .card-product-sale-tag {
      top: 45px;
  }
  </code></pre>
  <p>I tried this but it's not working:</p>
  <pre><code>if ($(&quot;.card-product-sale-tag&quot;).attr('show-value') == 1 &amp;&amp; $(&quot;.card-product-new-tag&quot;).attr('show-value') == 0) {
      $(&quot;.card-product-sale-tag&quot;, this).css(&quot;top&quot;, &quot;10px&quot;);//this is not the way I want by the way... I want &quot;top: -35px&quot; and finally &quot;10px&quot;.
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/5XVEh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5XVEh.png" alt="enter image description here" /></a></p>