0
<!DOCTYPE html>
<html>
<head>
  <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
</head>
<body>
  <ul>
    <li>Go to the store</li>
    <li>Pick up dinner</li>
    <li>Debug crash</li>
    <li>Take a jog</li>
  </ul>
  <script type="text/javascript">
  $("li").toggle(
      function () {
        $(this).css({"list-style-type":"disc", "color":"blue"});
      },
      function () {
        $(this).css({"list-style-type":"disc", "color":"red"});
      },
      function () {
        $(this).css({"list-style-type":"", "color":""});
      }
    );
  </script>

</body>
</html>

The above code toggle() not working, there i used jquery-latest.min.js. But if i change it to jquery-1.7.1.min.js then it works fine.

Please explain someone what's the problem jquery latest with .toggle() ? or am i missing anything ?

Thanks.

Arif
  • 5,276
  • 3
  • 45
  • 76

0 Answers0