it will be `dateFormat` not `format`
$('input[name="dateOfBirth"]').datepicker({ dateFormat: 'dd-mm-yy' })
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
$('input[name="dateOfBirth"]' ).datepicker({
dateFormat: 'dd-mm-yy'
});
<!-- language: lang-html -->
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.js" data-modules="effect effect-bounce effect-blind effect-bounce effect-clip effect-drop effect-fold effect-slide"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
<h1>Datepicker with Date Format (dd/mm/yy) using JQuery</h1>
<p>Date picker: <input type="text" name="dateOfBirth" /></p>
<br>
Date Format : dd-mm-yy
<!-- end snippet -->
You need to do like below:-
$( ".startdate" ).datepicker({
dateFormat: 'dd/mm/y',//check change
changeMonth: true,
changeYear: true
});
Example:-
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-js -->
$( ".startdate" ).datepicker({
dateFormat: 'dd/mm/y',//check change
changeMonth: true,
changeYear: true
});
<!-- language: lang-html -->
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/js/bootstrap.js" data-modules="effect effect-bounce effect-blind effect-bounce effect-clip effect-drop effect-fold effect-slide"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" />
<h1>Datepicker with Date Format (dd/mm/y) using JQuery</h1>
<p>Date picker: <input type="text" class="startdate" size="30"/></p>
<br>
Date Format : dd/mm/y
<!-- end snippet -->