So i'm using many Jquery plugins that work perfectly when i statically create the elements. but when the elements are created through .html()
or .append()
these plugins do not seem to work anymore, and i can't seem to figure out why. Any hint ? Thanks in advance.
So here is an example of a table that i want to create and add the plugin data-table to it:
<a href="javascript:void(0)" title="" onclick="AddElements();">Add</a>
<div id="Container"></div>
<script>
function AddElements()
{
CodeSrouce = '<table cellpadding="0" cellspacing="0" border="0" class="dTable"><thead><th>Name</th><th>Id</th></thead><tbody>';
for(i=0;i<3;i++)
{
CodeSrouce += '<tr><td>'+Name[i]+'</td><td>'+Id[i]+'</td></tr>';
}
CodeSrouce += '</tbody></table>';
$("#Container").html(CodeSrouce);
}
</script>