Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Location
    Spain, Valencia
    Posts
    20,492
    Tokens
    3,575
    Habbo
    GoldenMerc

    Latest Awards:

    Default How to do a x5 sum with javascript

    Well im trying to make a free kart system just to learn javascript and iv got most of it done other than the sums of like buying more than one of a item?
    So how would i go about multiplying a item ?
    Ross

  2. #2
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    <SCRIPT Language = JavaScript>
    howMuch=5
    itemQuant=1
    total = itemQuant*howMuch
    alert(total)
    </SCRIPT>
    Something along those lines. Im not too good with js but i tried lol

    Lew.
    Im not here to be loved, I love to be hated :-}


  3. #3
    Join Date
    Apr 2010
    Location
    Newcastle
    Posts
    655
    Tokens
    50

    Default

    You'd use the * operator (which is pretty much the same in any language)

    Here's a list of operators: http://www.w3schools.com/js/js_operators.asp

    Note to Lew: The "language" attribute is deprecated, use "type" instead, eg. <script type="text/javascript">

Posting Permissions

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