My CSS looks like:
/* works */
.badger-left:after {
left: 0;
border-radius: 6px 0 6px 0;
background: #428bca;
}
jQuery to change it on the fly:
$('.badger-left:after').css('background-color', "red"); // doesnt work
$('.badger-left').attr({ 'data-badger': "USA" }); // works
HTML:
<div class="col-sm-12 badger-left" data-badger="">
</div>
Why isn't the jQuery selector working and what should I do to make it work? http://screencast.com/t/onWs4KDJVD -- where it says "USA" (USA is set from the attr. data-badger in jquery), that background needs to change to red (or whatever color specified) via jQuery.
Thanks