<script src="Public/Home/js/jquery-1.11.1.min.js"></script> <script> function addree() { var myDate = new Date(); var t='10-01'; var arr = {"元旦":"01-01", "劳动节":"05-01","国庆节":"10-01" ,"圣诞节":"12-25"}; for (var items in arr) { if(arr[items]==t) { var c=1; break; } else { c=0; } } alert(c); } </script> <button onclick="addree();" style="width:50px; height:50px;">点击</button>
如果c=1的时候 证明存在,否则不存在!