<div id="test">1.07.2013</div>
<script type="text/javascript" src="http://yandex.st/jquery/1.7.2/jquery.min.js"></script> <script> $(document).ready(function(){ $(".data-tst").each(function () { var dat=$(this).text().split('.'); var tstDat = new Date(dat[2], +dat[1]-1, dat[0] ) var tstDay=((+tstDat - new Date())/(24*60*60*1000)) if(tstDay<1.5)$(this).css({"background-color":"red"}); if(tstDay<0)$(this).css({"background-color":"#AFAFAF"}) }); }); </script> <div id="test" class="data-tst">28.06.2013</div> <div id="test" class="data-tst">3.07.2013</div> <div id="test" class="data-tst">1.07.2013</div> <div id="test" class="data-tst">2.07.2013</div>
<input type="checkbox" checked name="checkbox" value="">
<div id="test" class="data-tst"></div>
<style type="text/css"> input[type="checkbox"] { background-color:#fff; } input[type="checkbox"]:checked { background-color:#000; } </style> <input type="checkbox" name="checkbox" value="">