Using jQuery to 'click' a li element

后端 未结 6 1860
误落风尘
误落风尘 2020-12-31 08:01

I have a

    element that dynamically generates the
  • elements and simply want to run a onclick event

    
    
            
6条回答
  •  醉话见心
    2020-12-31 09:02

    You can do this without assigning id to ul

    $('ul').on('click','li.searchterm',function(){
    //do your stuffhere;
    });
    

提交回复
热议问题