Show (Open) Bootstrap Modal Popup on Anchor Link Click using jQuery

Last Reply one year ago By dharmendr

Posted one year ago

my modal pop up id is: my-modal

i want to open it on the click event of anchor i should position modal pop up id in href property of anchor tag..?

<a class="Update" href="javascript:; #my-modal"> <i class="ace-icon fa fa-pencil-square-o"></i> |</a>


Posted one year ago

Hi Shud,

Refer below code.


<script type="text/javascript" src=''></script>
<script type="text/javascript" src=''></script>
<link rel="stylesheet" media="screen" href='' />
<link rel="stylesheet" href="" />
<script type="text/javascript">
    $(function () {
        $("a[class='Update']").click(function () {
            return false;
    <a class="Update" href=""><i class="ace-icon fa fa-pencil-square-o"></i>|</a>
<div id="MyPopup" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                <h4 class="modal-title">
            <div class="modal-body">
                Welcome to
            <div class="modal-footer">
                <input type="button" id="btnClosePopup" value="Close" class="btn btn-danger" data-dismiss="modal" />