I'm trying to build a dynamic jquery selector with the following code:
var section_id = "{segment_3}";
var num_children = $('#'+ section_id + ' ul').children().size();
where segment_3 is a value I successfully retrieve from the url string, which, for example, might return the value of "section_one"
But when trying to create the variable num_children, this reference doesn't work. How do I construct the code to build a dynamic reference? Thanks for any help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…