i want to take text from <li> selected from user as cookie value..
but help me to set Var selected as cookie value
please suggest correction in this code
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jcookie.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("li").click(function() {
var selected = $(this).html();
});
$.cookie("selection",selected);
alert($.cookie("example"));
});
</script>
<ul> select type
<li> left hand</li>
<li> right hand</li>
</ul>