I have a slider of 14 elements. It is necessary under the slider line - 4 blocks with inscriptions: first, second, third, fourth. I coped with it. I want, depending on which group the block is from, its name is framed

  • the first five blocks in the first group,
  • four following in the second
  • three following in the third
  • the last two in the fourth

and

<div class="jMyCarousel"> <ul> <li class="1"><div class="news-text"><p>!1!Text</p></div></li> <li class="1"><div class="news-text"><p>!2!Text</p></div></li> <li class="1"><div class="news-text"><p>!3!Text</p></div></li> <li class="1"><div class="news-text"><p>!4!Text</p></div></li> <li class="1"><div class="news-text"><p>!5!Text</p></div></li> <li class="2"><div class="news-text"><p>!6!Text</p></div></li> <li class="2"><div class="news-text"><p>!7!Text</p></div></li> <li class="2"><div class="news-text"><p>!8!Text</p></div></li> <li class="2"><div class="news-text"><p>!9!Text</p></div></li> <li class="3"><div class="news-text"><p>!10!Text</p></div></li> <li class="3"><div class="news-text"><p>!11!Text</p></div></li> <li class="3"><div class="news-text"><p>!12!Text</p></div></li> <li class="4"><div class="news-text"><p>!13!Text</p></div></li> <li class="4"><div class="news-text"><p>!14!Text</p></div></li> </ul> </div> <div class="buttom_block"> <ul> <li> 1_блок </li> <li> 2_блок </li> <li> 3_блок </li> <li> 4_блок </li> </ul> </div> 

The question is how to recognize the 1st element in the block. I want to compare the first element: if it is <li class="1"> , then highlight the first block. Help me find the position of the first element.

All program code can be downloaded here . Password 1234.

Thank you very much.

    1 answer 1

    guys, HTML is not a programming language, but a hypertext markup language, i.e. is a static syntax of this web page. And dynamic change is out of the question. For these purposes, and created javascript, VB, etc. PCP allows you to do beauty with html-code, but alas, it requires access to the server, i.e. update the page, send a NEW html-code. so you can't do without java script

    • And how to make it so that when adding elements to a block, you do not have to go to js code, and you can only edit html code? For example, the first block includes 5 elements, well, so that you can add a couple more elements to this block and in html indicate which one. - murad30
    • I did for 14 elements, well I need to do for an arbitrary number - murad30