Java Script to get todays date in HTML date field

I want to display my date in HTML input type=”date” in dd/mm/yyyy format

My Code

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript getDate</h2>

<input type="date" id="demo" name="rwrkDate" required="true" >

<script>
const d = new Date();
var date=d.getDate();
var month=d.getMonth();
var year=d.getFullYear();
var today=date+'/'+month+'/'+year;
document.getElementById("demo").value = today;
</script>

</body>
</html> 

I get the date field with mm/dd/yyyy only and does not display the date. Secondly how do I get previous date if some checks are implemented.