Java
Java
css("background-color", "#FF00FF");
$( ".btn" ).click(function() {
var idBtn = $( this ).attr( "name" );
$.ajax({
type:"POST",
url:"estado.php",
data:"idBtn=" + $( this ).attr( "name" ),
success:function(r){
if (r == 0) {
alert("llegue a 0");
$(this).addClass("off");
$(this).removeClass("on");
};
if (r == 1) {
alert("llegue a 1");
$(this).addClass("on");
$(this).removeClass("off");
};
//$('#select2lista').html(r);
}