mardi 9 juillet 2019

How to print the values in jquery into html text?

I wanted to join the HTML text with the values of the item.certificate_name. I've tried many things but any of it didn't works.

The line I mean is I commented <!-- I WANTED THE CERTIFICATE NAME TO BE HERE-->. I've already inspected, I've already got the name value. The only problem is how to join the text with the value?

<div class="col-xs-12">
  <div class="row">
    <div class="col-xs-2">
      <i class="glyphicon glyphicon-trash center" style="font-size: 50px"></i>
    </div>
    <div class="col-xs-8">
      <div class="clTulisanHapus center" id="idTulisanHapus">
        Anda Yakin ingin menghapus Pelatihan?
        <!-- I WANTED THE CERTIFICATE NAME TO BE HERE -->
      </div>
    </div>
  </div>
</div>
<div class="col-md-offset-8">
  <div class="btn-group">
    <input type="hidden" id="idDataId">
    <input type="hidden" id="idDataNama">
    <button type="button" id="idBtnHapusBatal" class="btn clBtnMdlHapus">Tidak</button>
    <button type="button" id="idBtnHapusHapus" data-id="${item.id}" class="btn clBtnMdlHapus">Ya</button>
  </div>
</div>

$('#idBtnHapusHapus').click(function() {
  var angka = $('#idDataId').val();
  var angka = $('#idDataNama').val();
  debugger;

  $.ajax({
    url: './hapussertifikasi/' + angka,
    type: 'DELETE',
    success: function(model) {
      debugger;
      window.location = './sertifikasi'
    },
    error: function(model) {
      debugger;
    }
  });
});




Aucun commentaire:

Enregistrer un commentaire