Advertisement
andreluizG

função abrir fechar Modal JS

Jun 23rd, 2021
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('.abrir-modal').click(function(){
  2.     $('.modal').toggleClass('active');
  3.     var condicao = $('.modal').hasClass('active');
  4.     if(condicao){
  5.         $(this).text("fechar Modal");
  6.     }else{
  7.         $(this).text("Abrir Modal")
  8.     }
  9. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement