javascript - add two li elements into the end of the ul -
here jsfiddle tried this: http://jsfiddle.net/fxmfh/
i want add 2 li's end of submenu jquery, seems doesnt navigate ul needs to:
$(document).ready(function() { $(".navigation_container nav > ul > li > ul").append('<li><a href="#">test</a></li>'); });
this must problem:
$(".navigation_container nav > ul > li > ul")
i must doing noobish here..
try
$(document).ready(function() { $(".navigation_container nav > ul > li > div.sub-menu > ul").append('<li><a href="#">test</a></li>'); });
demo: fiddle
but shorten selector
$(document).ready(function() { $(".navigation_container nav div.sub-menu > ul").append('<li><a href="#">test</a></li>'); });
demo: fiddle
Comments
Post a Comment