www.webdeveloper.com
Results 1 to 4 of 4

Thread: Simple adding subtracting with reset button

Hybrid View

  1. #1
    Join Date
    Apr 2012
    Posts
    3

    Question Simple adding subtracting with reset button

    Greetings,

    Thank you for reading my post. I have been working on trying to figure ou the code for this for a couple months now and I've had enough and am ready to ask for some help.

    I have this layout:

    http://i99.photobucket.com/albums/l3...6at11524AM.png

    My actions with this would be:

    Where the zeros are you would click on them and they would increase by 1 number, and the oops button would subtract a number.

    The reset button would reset the displays to zero again.

    It seems like it would be simple to code but I am having a really difficult time figuring it out.

    Any help or a place to look for reference would be greatly appreciated.

    Thank you! Kodi

  2. #2
    Join Date
    Nov 2007
    Posts
    418
    Basics here:

    Code:
    <div id="red" onclick="increment(this)">0</div>
    <div id="blue" onclick="increment(this)">0</div>
    <script>
    function increment(field){
      var currentValue = parseInt(field.innerHTML);
      field.innerHTML = currentValue + 1;
    }
    </script>

  3. #3
    Join Date
    Apr 2012
    Posts
    3

    Thanks you

    This is a good start. Thank you.

  4. #4
    Join Date
    Apr 2012
    Posts
    2

    Simple Adding reset button

    thanks for sharing with us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles