javascript - Modal work But not delete data with clicking confirm -


i want delete data modal confirmation.on remove click modal show when click confirm data not delete.

i trying cant understand whats wrong code

my code

<script> $(document).on("click", "#deletebtn", function (e) {       e.preventdefault();     e.stoppropagation();      var link = $(this).attr('data-adid');        console.log($("#mymodal btn-warning a"));      $("#mymodal .btn-warning a").attr('href',link);      $(".modal").modal("show"); }); </script>                       <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true">                         <div class="modal-dialog">                             <div class="modal-content">                                 <div class="modal-header">                                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>                                     <h4 class="modal-title">remove client account</h4>                                 </div>                                 <div class="modal-body">                                      body goes here...                                  </div>                                 <div class="modal-footer">                                     <button data-dismiss="modal" class="btn btn-default" type="button">close</button>                                     <button class="btn btn-warning" type="button"> <a href="" >confirm</a></button>                                 </div>                             </div>                         </div>                     </div>   <a  class="btn btn-warning" id="deletebtn" data-adid=?a=client&cdid='.$cd[$i][0].' data-toggle="modal" href="#mymodal">remove</a> 

i can't understand what's wrong code, since want delete data attribute, can below.

$(this).removeattr("data-adid"); 

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -