I'm trying to use Toggle my co开发者_如何学Cntents under separate list items. But what s the best method to implement this in a generic way. I dont want to give each content a separate class or id
http://jsfiddle.net/kKDWR/6/
You can use the jQuery selector children. Try this example:
http://jsfiddle.net/kKDWR/8/
Or you can use .find()
You make use of jQuery ... and you implement your feature in a jquery way. There's nothing wrong with it.
I'd only recommend to have a parent element (propably your current <UL>) with an ID (for example <ul id="forum_entries>").
So you can address the items as $(".tog", "#forum_entries"). This can be much faster than simply addressing by classname, if your document becomes large.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论