I'm new to this and it's my first message, I hope to do it right.
I have a DIV with a white background which when you click on it, its background changes color to red, besides a message appears asking the user what action he wants to perform. Well, what I want is that while the message is on the screen, the background of the DIV remains in red, and when you exit this screen by giving Cancel, return to blank. It is worth mentioning that the message that appears is with a Jquery plugin called jqueryconfirm.
In the first instance I had already achieved what I wanted, my problem is because when I clicked for the second time, the background of my DIV no longer changes color, and I do not understand why. Let's see if someone can help me.
This is the code:
$('.clave').on('click',function(){
$(this).addClass('fondo_rojo');
var valorclick = $(this).val();
var elemento = $(this)[0];
$.confirm({
theme: 'material',
title:'Atencion',
content:'¿Que desea hacer?',
useBootstrap: false,
boxWidth: '350px',
buttons:{
Borrar: function(){
$.confirm({
title:'Atencion',
content:'¿Esta seguro de continuar y borrar el registro?',
useBootstrap: false,
boxWidth:'300px',
buttons:{
Adelante: function(){funcionBorrar(valorclick)},
Cancelar: function(){}
}
});
},
Editar: function(){ funcionConsultarRegistro(valorclick) },
Cancelar: function(){ quitarFondo(elemento) }
}
});
});
function quitarFondo(elemento){
$(elemento).addClass('fondo_blanco');
}