javascript - Java Script Not working in Internet Explorer -


created checkbox features jquery website, features working fine other browsers chrome, firefox, safari, opera etc.. not working in ie version. here code:

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>      <ul id="filters" style="list-style:none; margin-top:75px; line-height:30px; ">      <li>          <input type="checkbox" value="outdoor" id="outdoor" />          <label for="filter-category">outdoor</label>      </li>      <li>          <input type="checkbox" value="remote_monitor" id="remote_monitor" />          <label for="filter-category">remote monitor</label>      </li>        <li>          <input type="checkbox" value="battery" id="battery" />          <label for="filter-category">battery operated</label>      </li>  </ul> <div style="width:850px; height:148px; clear:both; margin-top:80px;">  <div  class="category outdoor " style=" float:left;  ">rocco</div>  <div  class="category remote_monitor camera" style="float:left;margin-top:-2px; margin-left:10px;">borocco</div>  <div  class="category battery" style="float:left; margin-top:-2px;margin-left:10px;">sylva</div>  <div  class="category battery outdoor " style="float:left; margin-top:-2px;margin-left:10px;">novesto</div>  <script> $('input').change (function() {          var selector = $('input:checkbox').map(function(){               return this.checked ? '.' + this.id : '';            }).get().join('');           console.log(selector);              var = $('div[class^="category"]');          if(selector.length)            all.hide().filter(selector).show()          else all.hide();      }); </script> 

anyone can please!

console.log() doesn't work in ie until dev tools window opened.

the short answer don't use console.log() in code unless actively testing. if testing, have dev tools open anyway, code work. if you're not testing, remove console.log(); serves no purpose.

a more detailed answer can found here: why javascript work after opening developer tools in ie once?


Comments