By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,117 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,117 IT Pros & Developers. It's quick & easy.

change color of article jQuery

oll3i
100+
P: 679
Expand|Select|Wrap|Line Numbers
  1. <section class="offers" id="featured-offers">
  2. <article id="item-3929173859" class="offer promo-bold" data-id="3929173858" data-location="Nysa">1</article>
  3. <article id="item-3929173859" class="offer promo-bold" data-id="3929173857" data-location="Nysa">2</article>
  4. <article id="item-3929173859" class="offer promo-bold" data-id="3929173856" data-location="Nysa">3</article>
  5. <article id="item-3929173859" class="offer promo-bold" data-id="3929173859" data-location="Nysa">4</article>
  6. </section>
i have so far
Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function () {
  2.  
  3. $(".offer promo-bold").each(function(){
  4. $(this).attr("data-id").css('backgroundColor','#FF0'); 
  5.  
  6.  });
  7.  });
Feb 15 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.