Giter Site home page Giter Site logo

jsassignment2's Introduction

Display Current Date and Time:-

  • This is a simple HTML file that displays the current date and time when a button is clicked.

How to Use:-

  • To use this code, simply open the index.html file in a web browser.
  • Click the "Display Date and Time" button to see the current date and time displayed below the button.

Code Explanation💫:-

  • The index.html file contains the HTML code for the button and the script that displays the date and time.

  • The button is created using the tag with an onclick attribute that calls the displayDateTime() function when clicked.


  • The displayDateTime() function uses the Date object to obtain the current date and time, and the toLocaleString() method to convert it to a human-readable format.
  • The date and time is then displayed in a

    element with an id of "datetime" using the innerHTML property of the document.getElementById() method.


License 🪪:-

  • This code is licensed under the MIT License. See the LICENSE file for details.

jsassignment2's People

Contributors

coderstar1234 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.