I'd like to create a list and be able to toggle the display of children items on click. Should be simple but i can't get it to work. Any thoughts?
<script>
$(document).ready(function(){
$("dt a").click(function(e){
$(e.target).children("dd").toggle();
});
});
</script>
<style>
dd{display:none;}
</style>
<pre>
<dl>
<dt><a href="/">jQuery</a></dt>
<dd>
<ul>
<li><a href="/src/">Download</a></li>
<li><a href="/docs/">Documentation</a></li>
<li><a href="/blog/">Blog</a></li>
</ul>
</dd>
<dt><a href="/discuss/">Community</a></dt>
<dd>
<ul>
<li><a href="/discuss/">Mailing List</a></li>
<li><a href="/tutorials/">Tutorials</a></li>
<li><a href="/demos/">Demos</a></li>
<li><a href="/plugins/">Plugins</a></li>
</ul>
</dd>
</dl>
</pre>