HTML DOM DD Object

The DD object represents an HTML <dd> element. Access a DD Object You can access a <dd> element by using getElementById(): Example var x = document.getElementById(“myDD”); Try it Yourself » Create a DD Object You can create a <dd> element by using the document.createElement() method: Example var x = document.createElement(“DD”); Try it Yourself » Standard Properties and […]

JavaScript Set Date Methods

Set Date methods let you set date values (years, months, days, hours, minutes, seconds, milliseconds) for a Date Object. Set Date Methods Set Date methods are used for setting a part of a date: Method Description setDate() Set the day as a number (1-31) setFullYear() Set the year (optionally month and day) setHours() Set the […]

JavaScript Date Objects

JavaScript Date Output By default, JavaScript will use the browser’s time zone and display a date as a full text string: Thu Jul 05 2018 12:12:01 GMT+0500 (Pakistan Standard Time) You will learn much more about how to display dates, later in this tutorial. Creating Date Objects Date objects are created with the new Date() constructor. There […]