Article

Get day

https://cdn.jsdelivr.net/npm/[email protected]/dist/js.cookie.min.js
Copy to clipboard

Once a date object has been defined we can use methods that it provides to get and set specific information about the date. For example this code gets the day of the week using the getDay() method that the object specifies: https://raw.githubusercontent.com/finsweet/jqueryCourse/main/jsobjects/ex8.js?actionable=true The day_of_week will have the value 1, because the days of the week start counting from 0. 25 december 1995 was the second day of the week, a Monday.

<script>
$(document).ready(function(){
  XT1
});
</script>
Copy to clipboard
Send to Live Demo

Live demo

<div id="minidivpage" class="example-live"><div id="resultdiv">.</div></div>

<script>    
$(document).ready(function() {
  XT1
});
</script>
<script>
  
</script>
Copy to clipboard
Press the Run Demo button to execute the scripts above.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Your browser is too small

Resize your browser to be at least 769px wide.