jQuery .click() .show() function issues

cookies

New Member
Could anyone please let me know what i'm doing wrong.I have:\[code\]//My HTML <div> <ul> <li id="test"><a href="http://stackoverflow.com/questions/15679124/#">Main Item 1</a></li> <ul class="list-in-list"> <li><a href="http://stackoverflow.com/questions/15679124/#">Item 1</a></li> <li><a href="http://stackoverflow.com/questions/15679124/#">Item 2</a></li> <li><a href="http://stackoverflow.com/questions/15679124/#">Item 3</a></li> </ul> <li><a href="http://stackoverflow.com/questions/15679124/#">Main Item 2</a></li> <li><a href="http://stackoverflow.com/questions/15679124/#">Main Item 3</a></li> </ul> </div>//My CSS .list-in-list { display:none; }//My jQuery $(document).ready(function() { $('#test').click(function() { alert("hello"); }); });\[/code\]My final goal is to show that none displayed content if you press a list item, so that it expands neatly. However, i can't seem to get that alert() appearing in any way. Should i use an id for all list items in the main list, or is it enough with a class?/W
 
Back
Top