I have a element that dynamically generates the elements and simply want to run a onclick event
onclick
Use .on()
As your content is added dynamically so it is not accessible directly ,So you have to use Event delegation.
$('#results').on('click','li.searchterm',function() { console.log('testing'); });