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>

Put lines 10&11 after line 7.

thanx friend..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.