Working on .net Core application. I have a button against each Client on by Clients screen. On click of button, I need a Modal dialog. The click event isnt getting fired, not sure why.

//Page html

<div id="businesses">
    <h3>List of all Businesses</h3>
    <div id="businessesTable">
        <table class="table table-condensed" id="businessIndexTable">
                    <th>Name </th>
                    <th>Logo </th>
                    <th>Email </th>
                @foreach (var client in Model.Clients)
                        <td class=""> <img src="@client.LogoUrl" class="img-rounded" height="100" width="100" /> </td>
                        <td><button id="btnCalcVS" class="btn btn-success" type="button"> Calculate Validator Score</button></td>

//Modal dialog that should open when user clicks on "btnCalcVS"

 <div class="modal" id="calculateVSModal" role="dialog" tabindex="-1">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                    <h4 class="modal-title">Calculate Validator Score: Client Name</h4>
                <div class="modal-body">
                    <form role="form" id="formCalculateVS">
                        <div class="form-group">
                            <input class="form-control" type="text" placeholder="Question" id="question" />
                        <div class="modal-footer">
                            <button type="button" data-dismiss="modal" class="btn btn-default">Close</button>
                            <button type="button" class="btn btn-success" id="calcVSScore">Calculate</button>


<!-- jQuery library -->
<script src=""></script>
<script type="text/javascript">
    $(document).ready(function () {      

        $(document).on("click", "btnCalcVS", function () {
            alert("We are here");

0 Answers