0
I have this code below for a calendar in Sharepoint 2013 That when user choose silver car in calendar field stay in silver color and when black stay in black color.
It only works on the IE browser, Firefox and Chrome does not work, anyone has any idea what it might be?
<script src="/sites/SiteAssets/jquery-2.1.4.min.js"></script>
<style>
.black{
background-color: #383838;
}
.silver{
background-color: #C8C8C8;
}
</style><script type="text/javascript">
$(function(){
$('.ms-acal-item').each(function(){
$(':contains("Preto")',this).addClass('black');
$(':contains("Prata")',this).addClass('silver');
});
});
</script>
by way of doubt tries to change
$(':contains("Preto")',this).addClass('black');
for$(":contains('Preto')",this).addClass('black');
-> Change selector single quotes to double quotes– andrepaulo