JQuery: Read each line of an element

Posted by Sarfraz on Stack Overflow See other posts from Stack Overflow or by Sarfraz
Published on 2010-04-07T14:01:10Z Indexed on 2010/04/07 14:03 UTC
Read the original article Hit count: 184

Filed under:
|
|
|
|

Hello,

Suppose I have this html markup:

<div id="wrapper">
    $(function(){
    // hide all links except for the first
    $('ul.child:not(:first)').hide();
    $("a.slide:first").css("background-color","#FF9900");

    $('ul.parent a.slide').click(function(){
        $('ul.parent a.slide').css("background-color","#3399FF");

        $('ul.parent a.slide').mouseout(function(){
            $(this).css("background-color","#3399FF");
        });

        $('ul.parent a.slide').mouseover(function(){
            $(this).css("background-color","#66CC66");
        });
    });
    });
</div>

What is the easiest way to read each line of code present in the div. How do I extract each line of code from that div or loop over each line styling in any way I want.

Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript