title: How to get the click event values outside the function in jQuery
body: <p>How can I get the onclick event (this value change when click on div) in jQuery?</p>
  
  <pre><code>$("ul li").click(function(){
    var v = $(this).val();
  });
  
  $(function(){
    alert(v);
  });
  </code></pre>