how to display date using javascript? -


as try below javascript code display date

<!doctype html>  <html>  <body>  <h1> javascript</h1>  <button type="button" onclick=document.getelementbyid('demo').innerhtml=date()">click me display date , time.</button>  <p id="demo"></p>  </body>  </html>

you have missed quotes in onclick="..."

<!doctype html> <html> <body> <h1> javascript</h1> <button type="button" onclick="document.getelementbyid('demo').innerhtml=date()">click me display date , time.</button> <p id="demo"></p> </body> </html> 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -