Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3842566
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:48:44+00:00 2026-05-19T15:48:44+00:00

For my first foray into html5, I’m trying to make a scoreboard for the

  • 0

For my first foray into html5, I’m trying to make a scoreboard for the game Farkle.

I have figured out how to make a lame looking but functional graph system for up to five players, but I cannot figure out how to have it update more than once.

I realize that my code could be much better, but I didn’t want to write helper functions until I was sure how it would work.

As it is now, I’m getting weird behavior from the boxes. Rather than adding the “tally” to the total score, and drawing a box to reflect the new score, it does something that I don’t understand. Try typing 10, and then 90 for the same player to see what I mean.

Here is a “working” version, so that you can see my problem. http://jsfiddle.net/kBJB4/

edit: It seems like it rather than adding the numbers normally, eg. 1+1=2, it is doing some kind of append thing, eg. 1+1=11. I have no idea why.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T15:48:45+00:00Added an answer on May 19, 2026 at 3:48 pm

    The prompt() function call returns a string. So the variable tally in the following statement

    var tally = prompt("score?");

    is actually a string. So applying + operator to a string operand and an integer operand results in treating both the operands as string and performing string concatenation instead of integer addition. A simple fix is to convert the return value of prompt() to integer like:

    var tally = parseInt(prompt ("Score?"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making my first foray into WPF - I have a simple form with
My first foray into writing jQuery functions. I have this function, but I'm not
I am taking my first foray into PHP programming and need to configure the
Okay, so I'm doing my first foray into using the ADO.NET Entity Framework. My
This is my first foray into OO JS, having issues. Ideally in this scenario,
My first foray into the quirky world of emacs lisp is a function which
In my previous (and first) foray into Eclipse, I inherited another Developer's workstation and
This is my first foray into using an MVC construct (CodeIgniter). I'm hoping someone
I'm a (near complete) beginner, and this is my first foray into encryption -
This is my first foray into java, and I am having trouble understanding how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.