HTML Text Input * "value"; display in different text input

I've been looking for an answer to this issue but cannot find one. I'm attempting to input a number into a html input tag with the type being 'text'. I then need that value that's placed into that input multiplied by 2 and the answer displayed into another input.

My table looks like this. This is then repeated multiple times and closed with the appropriate table tag.

<table class="left-table" style="width:50%">


            <td class="options">
                <select class="expense-option">
                    <option>- Select Option -</option>
                    <option>Car Insurance</option>
                    <option>Car Loan</option>
                    <option>Car Park</option>
                    <option>Car Registration</option>
                    <option>Car Servicing</option>
                    <option>Credit Card</option>
                    <option>Dining Out</option>
                    <option>Health Insurance</option>
                    <option>Mobile Phone</option>
                    <option>Rent / Mortgage</option>
                    <option>Spending / Pocket Money</option>

            <td><input class="amount" id="input10" type="text" placeholder="Weekly $"></td>
            <td><input class="amount" id="output10" type="text" placeholder="Fortnightly $" readonly></td>
            <td><input class="amount" id="output20" type="text" placeholder="Yearly $" readonly></td>  


My JS is like this:

    <script src=""></script>
 var input1 = parseInt($("#input10").val());
     $("#output10").val(input1 * 2);
     alert("Please enter a valid number");

But still nothing works.


 var input1 = parseInt($("#input1").val());
     $("#output1").val(input1 * '2');
     alert("Please enter a valid number");
<script src=""></script>
				<td><input class="amount" id="input1" type="text" placeholder="Weekly $"></td>
				<td><input class="amount" id="output1" type="text" placeholder="Fortnightly $" readonly></td>

Here you have parsed the string to int

var input1 = parseInt($("#input1").val());

But in appending the value , you are trying to multiple with string 2 as it is enclosed inside '' . So solution of this is very simple, u need to multiple with int value .ie. 2 only.

var result = input1 * 2 ;

Need Your Help

What is a good pattern for storing implementations of an interface and retrieving specific implementations?

java interface subclass simulation

I am writing a simulator that has several interfaces which all simulated objects implement. The Entity interface has methods that all objects must have, such as ID retrieval and advancing the time ...