Jquery Toggle & passing data
- by Ross
I have created a toggle button with jquery but I need to pass my $id so it can execute the mysql in toggle_visibility.php.
how do I pass my variable from my tag ?
Yes
$("a.toggleVisibility").toggle(
function () {
$(this).html("No");
},
function () {
$.ajax({
type: "POST",
url: "toggle_visibility.php",
data: "id",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
$(this).html("Yes");
}
);