Answer the question
In order to leave comments, you need to log in
How to display text in each list using jquery?
Hello. I have a list in my code
<ul>
<li>
<span class="main">Клик</span>
<span class="nline">.....</span>
</li>
<li>
<span class="main">Клик</span>
<span class="nline">.....</span>
</li>
</ul>
$('.nline').hide();
$('.main').on('click', function(i){
// $(this).addClass('lidown');
$('.nline').eq(i).slideToggle();
});
li {
list-style: url('img/Up.png');
}
.lidown{
list-style: url('img/down.png');
}
Answer the question
In order to leave comments, you need to log in
$('ul').on('click', '.main', function(i){
$(this).next('.nline').slideToggle();
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question