In my Wordpress page I have many posts featuring song lyrics. I wish to style alternate lines of lyrics differently. I so far have the basics sorted, but I need helping using jQuery to prefix and suffix each line of lyrics with <li> and <ul> in order to use CSS styles to apply styles to odd and even lines as I saw in this post (http://stackoverflow.com/questions/358350/alternate-background-colors-for-list-items).
My HTML currently looks like the following:
<div id="lyricstext" style="overflow: auto; height: 340px; width: 640px;">
<ul>
Leave me alone
Leave me alone
Leave me alone
So just leave me alone
I said leave me alone
Leave me alone
Leave me alone
I’m not in the mood!
Piss off!
So when I say leave me alone
Nah T don’t play
I’m like Michael Jackson in a non-paedo way
The thought of mad partyin’, debauchery tortures me
My T-shirt reads “Fuck off and don’t talk to me”
Approaching every situation awkwardly
Like I’m mesmerized under some sort of sorcery
Who’s calling me? Don’t know – I’ll ignore it G
If I don’t share my time then is there more for me?
</ul>
</div>
So, I'm left wondering what JS to apply to the page to insert those <li>and </li>tags for me, in order to be able to style each alternate line differently. Thanks
<ul>may not contain text nodes.<li>blocks. Can't you see the question?