if($(\'#term\').children().length == 0){ $(\"#term\").append(\"\"); var i; for(i=1;
I have seen your ID is starting with Term so you can use .on() to add click event on DOM that are added later.
Term
Exapmple
$(document).on('click','[id^="Term"]',function(){ //code here });