Edit in JSFiddle

div.feedback {
    color: red;
    font-size: 0.5em;
    margin-top:-20px;
}
div.example {
    border: 2px solid #FF0000;
    margin-top: 20px;
    padding: 20px;
}
input {
    box-sizing: border-box;
    width: 276px;
    padding: 5px 7px;
    margin: 0;
    outline: 0;
    font-size: 1.1em;
    background: #fff;
    border: #e3e1d5 1px solid;
    border-radius: 2px;
    transition: all 0.15s ease-in-out;
}
table {
    margin: 1.6em 0;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    background-color: transparent;
}
tbody {
    display: table-row-group;
    vertical-align: middle;
    border-color: inherit;
}
table th, table td {
    padding: 8px;
    line-height: 20px;
    text-align: left;
    vertical-align: middle;
    border-top: 1px solid #edece4
}
<table>
    <tbody>
        <tr>
            <td>
                <input id="example2" type="text" value="Click me." />
            </td>
        </tr>
    </tbody>
</table>
<div id="example2-result" class="example">	<b>Day of the week:</b> -1
    <br/>	<b>Day of the month:</b> -1
    <br/>	<b>Month:</b> -1
    <br/>	<b>Year:</b> -1
    <br/> <b>Date as text:</b> -1
    <br/>
</div>
$("#example2").datepicker({
    dateFormat: "yy-mm-dd",
    onSelect: function () {
        var div = $("#example2-result");
        var date = $("#example2").datepicker('getDate');
        var tmp = "<b>Day of the week:</b> " + date.getDay() + "<br/>";
        tmp += "<b>Day of the month:</b> " + date.getDate() + "<br/>";
        tmp += "<b>Month:</b> " + date.getMonth() + "<br/>";
        tmp += "<b>Year:</b> " + date.getFullYear() + "<br/>";
        tmp += "<b>Date as text:</b> " + date.toISOString() + "<br/>";
        div.html(tmp);
    }
});