hello!
My new plugin use jquery to make a menu tree. It have to create dinamic elements.
But, when I create a link element, Jquery ignory the click event. I think the append function is creating text instead html elements.
I tried the code:
jQuery(document).ready(function($){
// the top level menu - click event
jQuery('.myclass').click(function() {
var id = $(this).attr('name');
alert(id);
$('#mylist-'+id).append("<a class=\"myclass2\" href=\"#\" name=\"test\" > TEST </a> ");
}); // end click
// the second level menu - event click
jQuery('.myclass2').click(function() {
var id = $(this).attr('name');
alert(id);
});
}); //end jquery
When click in link (class=myclass) I need create a link (class=myclass2) and it need to call a second function when clicked.
The fist event worked well and create the element. But I didn't get the second alert when click in the test link (class=myclass2).
Someone have even tried to do something like that?