views:

24

answers:

1

If I have a list and a link, like this:

<a href="">Select</a>

<ul>
    <li>f</li>
    <li>fd</li>
    <li>fa</li>
    <li>fd</li>
</ul>

<script> $("ul").selectable(); </script>

Is it possible to make an item be selected on any arbitrary event? Something like:

$('a').bind('click', function()
{
      $('.ul-selectable').children().first().select('on');
      $('.ul-selectable').children().last().select('off');
});
A: 

Why not? Just create a class and on selecting a particular item apply that class to that particular item :)

Snake