DOM. finding last in ordered list and add span style to list element

The need is, to find the last list element within a navigation tree and color it in red. The navigation tree can have different numbers of list elements, means it grows or shrink dynamicly.

The website wich is displaying the navigation tree is using following JavaScript libary files:

/js/prototype/[url removed, login to view]">

/js/prototype/[url removed, login to view]">

/js/scriptaculous/[url removed, login to view]">

/js/scriptaculous/[url removed, login to view]">

/js/scriptaculous/[url removed, login to view]">

/js/scriptaculous/[url removed, login to view]">

/js/scriptaculous/[url removed, login to view]">

/js/jq/[url removed, login to view]">

/js/jq/[url removed, login to view]">

It is not possible to use additionaly libs like [url removed, login to view]

Also it is not possible to replace [url removed, login to view] by another version.

So you have to deal with the mentioned files.

Programming a custom Function would be the only way to make it work.

Following HTML shows the navigation tree:

<ol class="head_cat_list">

<a href="#" class="head_list"><span>E-Shop</span></a>

<li><span id="red"> <a href="#"> New Arrival </a></span> </li>

<li><span id="red"> <a href="#"> Bags </a></span> </li>

<li><span id="red"> <a href="#"> Shoes </a></span> </li>

<li><span id="red"> <a href="#"> Accessoires </a></span> </li>

<li><span id="red"> <a href="#"> Clothing </a></span> </li>

<li><span id="red"> <a href="#" class="current"> Sale </a></span>

<ul class="subcategory">

<li> <a href="#"> Bags </a> </li>

<li> <a href="#"> Shoes </a> </li>

<li> <a href="#"> Clothing </a> </li>

<li> <a href="#"> Sale </a> </li>




<span> Sale </span><br>

<ol class="head_cat_list">

<li><span id="salered"> <a href="#"> Accessoires 2 </a></span> </li>

<li><span id="salered"> <a href="#"> Clothing 2 </a></span> </li>

<li><span id="salered"> <a href="#"> Sale </a></span> </li>


In this list the word "Sale" within ID "red" should be coloured in red. The second word Sale within class "subcategory"

and no other string containing "Sale" should be affected or rather being coloured in red.

Also check Project files in Attachment

Compétences : Javascript

en voir plus : tree with jquery, tree red, tree javascript jquery, tree in jquery, this class jquery, the elements of programming style, prototype validation, programming style, min tree, li.be, li-be, jquery class, elements of programming style, dom programming, c span programming, x js, treeview, span, ol, last

Concernant l'employeur :
( 18 commentaires ) Munich, Germany

Nº du projet : #2345406

Décerné à:


In fact, it is only one line of code. Award your project to me and I send it right away. And yes, I have tested it before bidding.

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 0 jours
(45 Commentaires)

3 freelance font une offre moyenne de $30 pour ce travail


I can do this right now!

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(1 Évaluation)

It's already done, check your PMB for sample. In PURE javascript code or jQuery; for jQuery code its a one line only; for javascript it shouldn't take many as well; actually I already have a tested, working code

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(0 Commentaires)