As per your fiddle,
you forgot to include jQuery in the page. Once you add that, the script will run fine.
If you want to automate that for all click events with rel, then
$(document).ready(function () {
$("a[rel]").click(function () {
var divClass= $(this).attr('rel');
$("." + divClass).toggle("slide");
});
});