jQuery:
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"/>
$(document).ready({
$(".title").click(function(){
var descID = $(this).attr("id");
var newID = "#"+descID+"d";
$(newID).slideToggle('slow');
});
});
HTML:
<span id="3" class="title">title</span>
<span id="3d" class="description">description</span>
CSS:
.description {
display: none;
}
Not a jQuery/javascript expert. What am I missing? I’m trying to get the appropriate description to slide toggle while clicking on the proper title. Right now I don’t see anything happen.
There are a fair number of errors. Corrected and documented inline.