I have a element that dynamically generates the elements and simply want to run a onclick event
onclick
You can do this without assigning id to ul
$('ul').on('click','li.searchterm',function(){ //do your stuffhere; });