March 16, 2012

how to highlight text that has a list with an image bullet?

Question by Joseph Walker

how to highlight only the (li) list of text that has a image bullet? How can I accomplish this.

           <ul>
                <li> test A </li>
                <li> test B </li>
                <li> test C </li>
           </ul> 

Answer by Starx

list-style-image is set on the ul [Check here] and correct way to define multiple word CSS is not like [moreinfo]

$("ul").each(function(){
    if($(this).css("listStyleImage") != "") {
        $(this).addClass("highlight");
    }
});

Demo

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!