Explore BrainMass

Explore BrainMass

    Use HTML and JavaScript to display table from input

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    I did most of the homework part. I need someone to help me to fix it (see attachment for requirements)

    <!DOCTYPE html>
    <script type="text/javascript">
    document.write("Please Enter items purchased with price of each<br/> Item: Price, Item: Price<br/><br/>");
    document.write("Ex:Bread:2, Milk:7,rice:90 ");

    function split()
    var inputval=document.getElementById("textarea").value;
    var nameArray=inputval.split(":");
    var nameArray=inputval.split(",");



    document.write("<table border=1><tr><td>"+i+"</td><td>"+integer[i]+"</td></tr>");
    document.writeln("<table border=1><tr><td>Item</td><td>Price</td></tr>");


    <form id="splitform" action="">

    <textarea id="txtarea"rows="13" cols="36"></textarea></p>
    <input type="button" id="buttonsplit" onclick="split()" value="Organize!"/ ></p>


    © BrainMass Inc. brainmass.com March 5, 2021, 1:44 am ad1c9bdddf


    Solution Preview

    First I cleaned up some erroneous tags (stray p tags and a head tag, etc.). Then I moved the two initial document.write() lines out of the JavaScript and just put them in the HTML since they are static text. Also, I ...

    Solution Summary

    Make a page with HTML and JavaScript that parses user input in a specified format and makes a table of the results. The table will have two columns, one for item and one for price. The final row will display the total price.