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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -