<div class="btn-group">
<button type="button" class="btn btn-sm btn-success btn-flat dropdown-toggle" data-toggle="dropdown">
Action <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a id="action" class="a" href="#action" data-index="100" data-toggle="done">Done</a></li>
<li><a id="action" class="a" href="#action" data-index="100" data-toggle="processing">Processing</a></li>
<li><a id="action" class="a" href="#action" data-index="100" data-toggle="error">Error</a></li>
</ul>
</div>
<script>
$( "#action" ).on("click", "a.a", function(){
//alert('working');
var id = $(this).data('index');
var status = $(this).data('toggle');
var dataString = 'id=' + id + '&status=' + status;
$.ajax({
type: "POST",
url: "status.php",
data: dataString,
cache: false,
success: function (result) {
$("#" + id + " td:eq(10) span").text(status);
$("#" + id + " td:eq(10) span").removeClass();
$("#" + id + " td:eq(10) span").addClass('bg-' + status);
}
});
});
</script>
dymanic button not working on click event.tried with live and delegate.but not working