bootstrap popover button click event does not working using jquery -
i use code bootstrap popover follows,
<a href="javascript:void(0);" class="btn btn-primary btn-sm" rel="popover" data-placement="top" data-original-title="<i class='fa fa-fw fa-users'></i> enter new investor group" data-content="<div class='smart-form'><div class='col-sm-10'><label class='input'><input type='text' name='newinvestor' placeholder='investor group name' id='newinvestor' /></label></div><div class='col-sm-2'><button id='btntest' class='btn btn-primary btn-sm assignedgroup' type='button' data-target-id='newinvestor' >add</button></div></div><div class='clearfix'></div><br/>" data-html="true">add</a>
i trigger event on button click in jquery. code follows,
$("#btntest").click(function () { alert("you click on button"); });
what reason code not working?
i appreciate in advanced.
assuming code renders correctly, try code below.
$(function(){ $(document).on('click',"#btntest",function () { alert("test button clicked"); }); });
edited
take @ jsfiddle , see if works http://jsfiddle.net/jb5fexp3/
Comments
Post a Comment