Saturday, 4 March 2017

How to display date in Typescript by using Button event?



// Display Date in Typescript on Button Click Event
let displaydate =  new Date().toLocaleDateString();
let button = document.createElement('button');
button.textContent = "Say Todays Date";
button.onclick = function ()
{
   alert(displaydate);
}
document.body.appendChild(button);

No comments:

Post a Comment