I wrote function while clicking a class name. and its works fine. but when i am append a tag with same class name the function is not working on that class.
<script>
$(document).ready(function() {
$("#btn1").click(function(){
$("p").append(" <b class='test'>Appended text</b>.");
});
$(".test").click(function(){
alert(12);
});
});
</script>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<ol>
<li class="test">List item 1</li>
</ol>
<button id="btn1">Append text</button>