Edit This Code:
<!DOCTYPE html>
<html>
<body>

<h3>A demonstration of how to access a TIME element</h3>

<p>I have a date on <time id="myTime" datetime="2014-02-14">Valentines day</time>.</p>

<p>Click the button to get the HTML content of the time element above.</p>

<button onclick="myFunction()">Try it</button>

<p><b>Note:</b> The time element does not render as anything special in any of the major browsers.</p>
<p><b>Note:</b> The dateTime property is only supported in Firefox and Opera 12.</p>

<p id="demo"></p>

<script>
function myFunction() {
    var x = document.getElementById("myTime").innerHTML;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy