<ul class="playlist">
<li class="track_name">$name1
<ul>
<li class="play"><a class="play_link" href="$url">play</a></li>
<li class="download"><a href="download.php?id=$url">download</a></li>
</ul>
</li>
<li> ... more tracks here
</ul>
<ul class="playlist">
... more playlists here
Given a dynamically generated unordered nested lists, what is the easiest way to replace text 'play' in <li class="play"> with $name1?
I've done the following:
var val = $('.play').closest('.track_name').clone().children().remove().end().text();
$('.play_link').text(val);
This gives me all track_names, but can't figure out how to get just the relevant track name.
TIA!