Giter Site home page Giter Site logo

game_js's Introduction

This project sample game by js

Steps:

  1. Create three files:

    index.html
    style.css script.js

  2. In the HTML file, type key emit and do exclamation enter.

  3. In the CSS file, Add a background color to the page: set the color to #c7c7c7.

  4. Change the color of the heading to #3189b3.

  5. Again in the HTML file, we want to link to our stylesheet by type link and enter.

  6. And we also need to link to the JavaScript above the ending body tag. By type script:src and write JS filename "script.js".

  7. Now we will add some JavaScript for Handling Events:

    Add a button to the HTML with the text Jump.
    Create a count variable to store how many times the button is clicked.
    Handle the click event for the button and increment the count variable during each click.
    Give the button an id, so we can refer to it using JavaScript with the documentgetElementByld() function.
    Use the window.onload event to take the reference of our button.
    To handle the click event, use the onclick handler of the button.
    Initialize the count variable to 0 and increment it when the button is clicked, like count += 1.

game_js's People

Contributors

wahabu avatar

Stargazers

 avatar Roman 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.