0

I am trying to learn myself html and found this js fiddle link

http://jsfiddle.net/xfkeM/

Now am trying to create a simple webpage ,but seems that am missing something as I can not see the desired output.

Here is my HTML Code part

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type='text/javascript' src='NewFolder/js.custom.js'></script>
</head>
<body>
<ul>
    <li class="togglevisibility">Toggle Me 1
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
        </ul>
    </li>
    <li class="togglevisibility">Toggle Me 2
        <ul> 
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
        </ul>
    </li>
    <li class="togglevisibility">Toggle Me 3
        <ul> 
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
        </ul>
    </li>
</ul>
<body>
</html>

and the custom.js

jQuery(document).ready(function($){
    $("li>ul").hide();

    $(".togglevisibility")
      .mouseenter(function() {
          $(this).children("ul").slideDown();
      })
      .mouseleave(function() {
          $(this).children("ul").slideUp();
      });
  });

What am I missing?

Sham
  • 414
  • 2
  • 6
  • 14

2 Answers2

1

You are missing jQuery itself! include

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

Mahesh Thumar
  • 4,257
  • 5
  • 22
  • 30
0
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>

include the file

Vikas Gautam
  • 997
  • 7
  • 23