Get value of selected object

Get value of selected object

Hi guys..I'm new with Jquery and I'm trying one thing.

I'm using a JQuery UI example like below:

  1.     <script type="text/javascript">
  2.     $(function() {
  3.         $("#selectable").selectable();
  4.     });
  5.     </script>


  1. <ol id="selectable">
  2.     <li class="ui-state-default" id="1">TEST</li>
  3.     <li class="ui-state-default" id="2">TEST</li>
  4.     <li class="ui-state-default" id="3">TEST</li>
  5.     ...
  6. </ol>


What I'm trying to do is to get the id of the selected object and add this ID to a variable so I can check the values that were selected.

Thanks in advance