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
Post a Comment