Hello,

I only started using jQuery recently and have hit a problem, I have an
application that is rendering a list of applications which could have
multiple releases within each application and multiple versions within
each release. I have the following markup:

<ol id="selectable">
    <li class="app_name">App1</li>
    <li class="app_release"><span class="bullet">&#8618;&nbsp;</
span>R1</li>
    <li class="app_version odd"><span class="bullet">&#8618;&nbsp;</
span>0.1</li>
    <li class="app_name">App2</li>
    <li class="app_release"><span class="bullet">&#8618;&nbsp;</
span>R1</li>
    <li class="app_version odd"><span class="bullet">&#8618;&nbsp;</
span>0.1</li>
    <li class="app_name">App3</li>
    <li class="app_release"><span class="bullet">&#8618;&nbsp;</
span>R1</li>
    <li class="app_version odd"><span class="bullet">&#8618;&nbsp;</
span>0.1</li>
    <li class="app_version even"><span class="bullet">&#8618;&nbsp;</
span>0.2</li>
    <li class="app_version odd"><span class="bullet">&#8618;&nbsp;</
span>0.3</li>
    <li class="app_release"><span class="bullet">&#8618;&nbsp;</
span>R2</li>
    <li class="app_version even"><span class="bullet">&#8618;&nbsp;</
span>0.1</li>
    <li class="app_version odd"><span class="bullet">&#8618;&nbsp;</
span>0.2</li>
    <li class="app_version even"><span class="bullet">&#8618;&nbsp;</
span>0.3</li>
    <li class="app_version odd"><span class="bullet">&#8618;&nbsp;</
span>0.4</li>
</ol>

When the user selects either a release or version I want to find the
previous <li> entry text with the class "app_name". So in the example
above, if the user clicks the very last <li> row I want to get the
Application text "App3".

I have taken the example code from the Selectable tutorial/
documentation and the following code works if I select the first <li>
above with class "app_version" but not if I select the last one:

        $application = $(this).prev(".app_name").text();

I've read the Selectors page and searched these groups and tried
several different ways of working but I'm struggling to make any
progress.

I do apologise in advance if this request is too basic!

Many thanks - Robert Swift.

Reply via email to