Any URL's added here will be added as
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<input type="text" id="NumberOfDays"> days have passed since the beginning of the year.
var today=new Date(); var currentYear=today.getFullYear(); var beginningOfTheYear = new Date(currentYear, 1, 1) // (1, 1 stands of 1st of January) var dateDifference = today - beginningOfTheYear; dateDifference=dateDifference / (1000 * 60 *60 *24); dateDifference=Math.round(dateDifference); document.getElementById("NumberOfDays").value=dateDifference;
Also see: Tab Triggers