I want to get the total sum of 3 items based on their price and quantity The Next CEO of Stack OverflowGet the last item in an arrayGet random item from JavaScript arraytotal price according to quantity written for multiple itemsOn the basis of quantity and product price, total price UpdateJavascript calculator based on item price and total priceHow to: Total that multiplies price by quantityCalculating quantity and price total in reactSumming prices based on quantityCalculate Quantity * Price = Total | Total / Price = QuantityHow to get a quantity box to update total price

What is the result of assigning to std::vector<T>::begin()?

Written every which way

What happened in Rome, when the western empire "fell"?

How does the mv command work with external drives?

Unreliable Magic - Is it worth it?

How to count occurrences of text in a file?

WOW air has ceased operation, can I get my tickets refunded?

Would a galaxy be visible from outside, but nearby?

To not tell, not take, and not want

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Return the Closest Prime Number

Why do airplanes bank sharply to the right after air-to-air refueling?

MessageLevel in QGIS3

sp_blitzCache results Memory grants

Can I run my washing machine drain line into a condensate pump so it drains better?

Indicator light circuit

Why didn't Khan get resurrected in the Genesis Explosion?

How do scammers retract money, while you can’t?

What does "Its cash flow is deeply negative" mean?

Novel about a guy who is possessed by the divine essence and the world ends?

Is it professional to write unrelated content in an almost-empty email?

Is it ever safe to open a suspicious html file (e.g. email attachment)?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

Why has the US not been more assertive in confronting Russia in recent years?



I want to get the total sum of 3 items based on their price and quantity



The Next CEO of Stack OverflowGet the last item in an arrayGet random item from JavaScript arraytotal price according to quantity written for multiple itemsOn the basis of quantity and product price, total price UpdateJavascript calculator based on item price and total priceHow to: Total that multiplies price by quantityCalculating quantity and price total in reactSumming prices based on quantityCalculate Quantity * Price = Total | Total / Price = QuantityHow to get a quantity box to update total price










-1















I want to get the total sum to display at the bottom of my document of 3 items based on their price and quantity. For example item 1 is worth $5, item 2 is worth $7 and item 3 is worth $11. I need a function and editing on my html input tags so I can display the full total if I where to choose different quantities per item.



This is what I have so far:




<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<script src="app.js"></script>
</head>
<body>
<h1>Marios Pest Control</h1>
<form>
<ul class="myList">
<img src="Blue_Goomba_SMWU.png" class="imgCenter">
<li>Goombas: 5 Coins (ea.)<l1> <br>
Total Number:
<input id="goombasInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="635-6354796_mkdd-bob-omb-bomba-de-tiempo-virus.png">
<li>Bob-ombs: 7 Coins (ea.)<li>
Total Number:
<input id="bob-ombsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="1200px-DeepCheepNSLU.png">
<li>Cheep-cheeps: 11 Coins (ea.)</li>
Total Number:
<input id="cheep-cheepsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
</ul>
<p id="myP">Click Submit To Get The Total:</p>
<button id="wrapper" onclick="myFunction()">Add Total</button>
</form>
<footer class="myFooter">
<p>Marios Pest Control</p> 2410 Birch Ave Lubbock, Tx 79404 <p>url: <a href="mariospestconrol.com">mariospestconrol.com </a> <p>email: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
</footer>

</body>
</html>












share|improve this question



















  • 6





    What do you have so far?

    – ziggy wiggy
    Mar 8 at 14:33






  • 1





    Post contents of myFunction()

    – Anurag Srivastava
    Mar 8 at 14:33















-1















I want to get the total sum to display at the bottom of my document of 3 items based on their price and quantity. For example item 1 is worth $5, item 2 is worth $7 and item 3 is worth $11. I need a function and editing on my html input tags so I can display the full total if I where to choose different quantities per item.



This is what I have so far:




<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<script src="app.js"></script>
</head>
<body>
<h1>Marios Pest Control</h1>
<form>
<ul class="myList">
<img src="Blue_Goomba_SMWU.png" class="imgCenter">
<li>Goombas: 5 Coins (ea.)<l1> <br>
Total Number:
<input id="goombasInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="635-6354796_mkdd-bob-omb-bomba-de-tiempo-virus.png">
<li>Bob-ombs: 7 Coins (ea.)<li>
Total Number:
<input id="bob-ombsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="1200px-DeepCheepNSLU.png">
<li>Cheep-cheeps: 11 Coins (ea.)</li>
Total Number:
<input id="cheep-cheepsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
</ul>
<p id="myP">Click Submit To Get The Total:</p>
<button id="wrapper" onclick="myFunction()">Add Total</button>
</form>
<footer class="myFooter">
<p>Marios Pest Control</p> 2410 Birch Ave Lubbock, Tx 79404 <p>url: <a href="mariospestconrol.com">mariospestconrol.com </a> <p>email: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
</footer>

</body>
</html>












share|improve this question



















  • 6





    What do you have so far?

    – ziggy wiggy
    Mar 8 at 14:33






  • 1





    Post contents of myFunction()

    – Anurag Srivastava
    Mar 8 at 14:33













-1












-1








-1








I want to get the total sum to display at the bottom of my document of 3 items based on their price and quantity. For example item 1 is worth $5, item 2 is worth $7 and item 3 is worth $11. I need a function and editing on my html input tags so I can display the full total if I where to choose different quantities per item.



This is what I have so far:




<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<script src="app.js"></script>
</head>
<body>
<h1>Marios Pest Control</h1>
<form>
<ul class="myList">
<img src="Blue_Goomba_SMWU.png" class="imgCenter">
<li>Goombas: 5 Coins (ea.)<l1> <br>
Total Number:
<input id="goombasInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="635-6354796_mkdd-bob-omb-bomba-de-tiempo-virus.png">
<li>Bob-ombs: 7 Coins (ea.)<li>
Total Number:
<input id="bob-ombsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="1200px-DeepCheepNSLU.png">
<li>Cheep-cheeps: 11 Coins (ea.)</li>
Total Number:
<input id="cheep-cheepsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
</ul>
<p id="myP">Click Submit To Get The Total:</p>
<button id="wrapper" onclick="myFunction()">Add Total</button>
</form>
<footer class="myFooter">
<p>Marios Pest Control</p> 2410 Birch Ave Lubbock, Tx 79404 <p>url: <a href="mariospestconrol.com">mariospestconrol.com </a> <p>email: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
</footer>

</body>
</html>












share|improve this question
















I want to get the total sum to display at the bottom of my document of 3 items based on their price and quantity. For example item 1 is worth $5, item 2 is worth $7 and item 3 is worth $11. I need a function and editing on my html input tags so I can display the full total if I where to choose different quantities per item.



This is what I have so far:




<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<script src="app.js"></script>
</head>
<body>
<h1>Marios Pest Control</h1>
<form>
<ul class="myList">
<img src="Blue_Goomba_SMWU.png" class="imgCenter">
<li>Goombas: 5 Coins (ea.)<l1> <br>
Total Number:
<input id="goombasInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="635-6354796_mkdd-bob-omb-bomba-de-tiempo-virus.png">
<li>Bob-ombs: 7 Coins (ea.)<li>
Total Number:
<input id="bob-ombsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="1200px-DeepCheepNSLU.png">
<li>Cheep-cheeps: 11 Coins (ea.)</li>
Total Number:
<input id="cheep-cheepsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
</ul>
<p id="myP">Click Submit To Get The Total:</p>
<button id="wrapper" onclick="myFunction()">Add Total</button>
</form>
<footer class="myFooter">
<p>Marios Pest Control</p> 2410 Birch Ave Lubbock, Tx 79404 <p>url: <a href="mariospestconrol.com">mariospestconrol.com </a> <p>email: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
</footer>

</body>
</html>








<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<script src="app.js"></script>
</head>
<body>
<h1>Marios Pest Control</h1>
<form>
<ul class="myList">
<img src="Blue_Goomba_SMWU.png" class="imgCenter">
<li>Goombas: 5 Coins (ea.)<l1> <br>
Total Number:
<input id="goombasInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="635-6354796_mkdd-bob-omb-bomba-de-tiempo-virus.png">
<li>Bob-ombs: 7 Coins (ea.)<li>
Total Number:
<input id="bob-ombsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="1200px-DeepCheepNSLU.png">
<li>Cheep-cheeps: 11 Coins (ea.)</li>
Total Number:
<input id="cheep-cheepsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
</ul>
<p id="myP">Click Submit To Get The Total:</p>
<button id="wrapper" onclick="myFunction()">Add Total</button>
</form>
<footer class="myFooter">
<p>Marios Pest Control</p> 2410 Birch Ave Lubbock, Tx 79404 <p>url: <a href="mariospestconrol.com">mariospestconrol.com </a> <p>email: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
</footer>

</body>
</html>





<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<script src="app.js"></script>
</head>
<body>
<h1>Marios Pest Control</h1>
<form>
<ul class="myList">
<img src="Blue_Goomba_SMWU.png" class="imgCenter">
<li>Goombas: 5 Coins (ea.)<l1> <br>
Total Number:
<input id="goombasInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="635-6354796_mkdd-bob-omb-bomba-de-tiempo-virus.png">
<li>Bob-ombs: 7 Coins (ea.)<li>
Total Number:
<input id="bob-ombsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
<img src="1200px-DeepCheepNSLU.png">
<li>Cheep-cheeps: 11 Coins (ea.)</li>
Total Number:
<input id="cheep-cheepsInp" type="number" name="Total Number Of">
<button>add</button>
<br> <br> <br> <br> <br> <br> <br> <br> <br>
</ul>
<p id="myP">Click Submit To Get The Total:</p>
<button id="wrapper" onclick="myFunction()">Add Total</button>
</form>
<footer class="myFooter">
<p>Marios Pest Control</p> 2410 Birch Ave Lubbock, Tx 79404 <p>url: <a href="mariospestconrol.com">mariospestconrol.com </a> <p>email: <a href="mailto:someone@example.com">someone@example.com</a>.</p>
</footer>

</body>
</html>






javascript html5






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 8 at 15:25









Anurag Srivastava

2,13311019




2,13311019










asked Mar 8 at 14:31









vmoovmoo

11




11







  • 6





    What do you have so far?

    – ziggy wiggy
    Mar 8 at 14:33






  • 1





    Post contents of myFunction()

    – Anurag Srivastava
    Mar 8 at 14:33












  • 6





    What do you have so far?

    – ziggy wiggy
    Mar 8 at 14:33






  • 1





    Post contents of myFunction()

    – Anurag Srivastava
    Mar 8 at 14:33







6




6





What do you have so far?

– ziggy wiggy
Mar 8 at 14:33





What do you have so far?

– ziggy wiggy
Mar 8 at 14:33




1




1





Post contents of myFunction()

– Anurag Srivastava
Mar 8 at 14:33





Post contents of myFunction()

– Anurag Srivastava
Mar 8 at 14:33












1 Answer
1






active

oldest

votes


















0














you can use this variant of myFunction() to get your thing done:



function myFunction(event) 
event.preventDefault();
let goombas = document.getElementById("goombasInp");
let bobombs = document.getElementById("bob-ombsInp");
let cheeps = document.getElementById("cheep-cheepsInp");

goombas = goombas.value * 5;
bobombs = bobombs.value * 7;
cheeps = cheeps.value * 11;

document.getElementById("myP").innerHTML += goombas+bobombs+cheeps;


document.querySelector("button#wrapper").addEventListener('click', myFunction);


I'll recommend/suggest you to remove: onclick="myFunction()", from your button, and move your script tag at the end of the file, right before you close






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065294%2fi-want-to-get-the-total-sum-of-3-items-based-on-their-price-and-quantity%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    you can use this variant of myFunction() to get your thing done:



    function myFunction(event) 
    event.preventDefault();
    let goombas = document.getElementById("goombasInp");
    let bobombs = document.getElementById("bob-ombsInp");
    let cheeps = document.getElementById("cheep-cheepsInp");

    goombas = goombas.value * 5;
    bobombs = bobombs.value * 7;
    cheeps = cheeps.value * 11;

    document.getElementById("myP").innerHTML += goombas+bobombs+cheeps;


    document.querySelector("button#wrapper").addEventListener('click', myFunction);


    I'll recommend/suggest you to remove: onclick="myFunction()", from your button, and move your script tag at the end of the file, right before you close






    share|improve this answer



























      0














      you can use this variant of myFunction() to get your thing done:



      function myFunction(event) 
      event.preventDefault();
      let goombas = document.getElementById("goombasInp");
      let bobombs = document.getElementById("bob-ombsInp");
      let cheeps = document.getElementById("cheep-cheepsInp");

      goombas = goombas.value * 5;
      bobombs = bobombs.value * 7;
      cheeps = cheeps.value * 11;

      document.getElementById("myP").innerHTML += goombas+bobombs+cheeps;


      document.querySelector("button#wrapper").addEventListener('click', myFunction);


      I'll recommend/suggest you to remove: onclick="myFunction()", from your button, and move your script tag at the end of the file, right before you close






      share|improve this answer

























        0












        0








        0







        you can use this variant of myFunction() to get your thing done:



        function myFunction(event) 
        event.preventDefault();
        let goombas = document.getElementById("goombasInp");
        let bobombs = document.getElementById("bob-ombsInp");
        let cheeps = document.getElementById("cheep-cheepsInp");

        goombas = goombas.value * 5;
        bobombs = bobombs.value * 7;
        cheeps = cheeps.value * 11;

        document.getElementById("myP").innerHTML += goombas+bobombs+cheeps;


        document.querySelector("button#wrapper").addEventListener('click', myFunction);


        I'll recommend/suggest you to remove: onclick="myFunction()", from your button, and move your script tag at the end of the file, right before you close






        share|improve this answer













        you can use this variant of myFunction() to get your thing done:



        function myFunction(event) 
        event.preventDefault();
        let goombas = document.getElementById("goombasInp");
        let bobombs = document.getElementById("bob-ombsInp");
        let cheeps = document.getElementById("cheep-cheepsInp");

        goombas = goombas.value * 5;
        bobombs = bobombs.value * 7;
        cheeps = cheeps.value * 11;

        document.getElementById("myP").innerHTML += goombas+bobombs+cheeps;


        document.querySelector("button#wrapper").addEventListener('click', myFunction);


        I'll recommend/suggest you to remove: onclick="myFunction()", from your button, and move your script tag at the end of the file, right before you close







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 8 at 18:57









        ApurvApurv

        146




        146





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55065294%2fi-want-to-get-the-total-sum-of-3-items-based-on-their-price-and-quantity%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived