0

I have a project. I don't know how to describe my problem but briefly onclick and $("#a").click(function(){ }) is not working. I will be grateful if you could help me

function kodOlustur() {
  $.post("func/islem.php", {
    islem: "kodolustur"
  }, function(sonuc) {
    $("#sonuc").html(sonuc);
    $("#full").html('<div class="card"><div class="card-body" style="background-color: #4CAF50;"><div class="sanloginpanel"><img class="container-fluid" style="height:128px; width:125px;" src="https://www.shareicon.net/data/512x512/2016/07/24/801257_sms_512x512.png"><br><p style="padding-top:20px;">İşleminizi güvenli bir şekilde tamamlamak için lütfen cep telefonunuza iletilen 4 haneli kodu giriniz</p><br><button id="yenile">Yenile</button><div class="tablerow"><input type="text" id="smscode" placeholder="* * * * *" class="login-input" required></div><br><div class="tableheader"><button style="background-color: #eb6027 !important; border-color:#eb6027 !important;" id="smsverify" class="btn btn-custom">Rezervasyonu Tamamla</button></div></div></div></div>');
  });
}
$("#yenile").click(function() {
  alert("aa");
  /// THİS NOT WORKİNG.
});
j08691
  • 204,283
  • 31
  • 260
  • 272
leatred
  • 1
  • 2
  • where is kodOlustur being called, if its more than once, remove the ID off the click even since there are multiple elements, they should never be duplicate IDS, Then look at dynamically created elements and event listeners. – Michael Mano Jul 15 '21 at 22:31
  • kodOlustur() is called in another click event $("#submit").click(function(){ if ($('#customCheck1').is(':checked')) { var adsoyad= $("#adsoyad").val(); var telefon= $("#telefon").val(); var email= $("#email").val(); var kisi= $("#kisisayisi").val(); if(adsoyad!="" && telefon!="" && email!="" && kisi!=""){ kodOlustur(); <-------------- such as – leatred Jul 15 '21 at 22:39

0 Answers0