I want to toggle .title class when we click on .title .content class toggle.Here i written this classes inside .I want to be toggle .title in a current class. I tried but not getting. Can anyone suggest me what might be the issue here?
$(document).ready(function() {
$('.title').click(function() {
$(this).find('.content').slideToggle();
});
});
.content {
display: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container">
<ol class="list-timeline">
<li>
<h3 class="title">The Establishment</h3>
<div class="content">
<p>Ascetur ridiculus mus. Suspendisse pellentesque convallis massa.</p>
</div>
</li>
<li>
<h3 class="title">150 Employee</h3>
<div class="content">
<p>Pellentesque habitant morbi tristique senectus.</p>
</div>
</li>
</ol>
</div>
.contentis inside of.list-timeline, not.title, which is adjacent to it. Thefindmethod looks inside of the element you call it on, so it had no chance to find the div you wanted to have it work on.