Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

153
Visualizações
Bootstrap confirmation is not working inside onClick event?

I have a button & I want to add bootstrap confirmation this is working fine when I'm calling directly but When I'm using confirmation code inside onClick Event this then Bootsrap Confirmation is not working. What is wrong here?

This is my code:-

$('.myButton').on("click", function() {
  $('[data-toggle=confirmation]').confirmation({
    rootSelector: '[data-toggle=confirmation]'
});
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-confirmation2/4.2.1/bootstrap-confirmation.min.js" integrity="sha512-LhgCuBuvISlfR3iVmjgchM6JrYvl16h/RJVsjdCfGXUahMHgmMJpavyIbluTuV3Ww8tJtGh2VAYayfoGvc84DA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<button data-toggle="confirmation" type="button" class="myButton mt-5 btn btn-primary btn-convert">Convert</button>

ThankYou!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda