No need to resort to ids.
If you structure is as in your question you can do
$(document).ready(function () {
// Hide the "view" div.
$('div.view').hide(); // maybe this should be handled by CSS rules
// Watch for clicks on the "slide" link.
$('div.slide').click(function () {
// When clicked, toggle the "view" div.
$(this).next().slideToggle(400);
return false;
});
});
Also i would remove the .hide()
part and use css for that
.view{
display:none;
}
Example at http://jsfiddle.net/gaby/bhhMC/