function not working
function not working
Hello,
I'm new to jquery so I'm sorry if this sounds crazy
Basically I created as script, I will show you a part of it
-
for(var i=0;i<data.results.length;i++){
options += '<li><a href="#" id="addsuggest">'+data.results[i].id+' - '+data.results[i].name+'</a></li>';
}
$('#suggestlist ul').html(options);
-
<div id="suggestlist"><ul style="list-style-type:none;">here list</ul></div>
now when I have a function addsuggest but when I click on the link nothing happens. If I make same link somewhere on the site, it works, but not there. As I understand, problem might be that, all content in <ul> is created with javascript, so somehow I need to link to my function... but how?