Writing datepicker value to console

Writing datepicker value to console

Hello,

I have this code:

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>datepicker demo</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<body>
<div id="datepicker"></div>
<script>
var x = $( "#datepicker" ).datepicker();
</script>
</body>
</html>

What I want to do is write x , where x is the date selected to the console using console.log . How would this be done?

Thanks,
Jim