Q: Do math from document.getElementById() with AJAX I have Python code like this
@app.route('/generate/transaction', methods=['POST'])
def generate_transaction():
    sender_public_key = request.form['sender_public_key']
    sender_private_key = request.form['sender_private_key']
    recipient_public_key = request.form['recipient_public_key']
    amount = request.form['amount']

    transaction = Transaction(sender_public_key, sender_private_key, recipient_public_key, amount)

    response = {'transaction': transaction.to_dict(),
                'signature': transaction.sign_transaction()}

    return jsonify(response), 200

and in HTML/AJAX I have this one
$(function() {
        $("#generate_transaction").click(function() {
            $.ajax({
                url: "/generate/transaction",
                type: "POST",
                dataType: 'json',
                data: $('#transaction_form').serialize(),
                success: function(response) {

                    document.getElementById('confirmation_sender_public_key').value = response['transaction']['sender_public_key'];
                    document.getElementById('confirmation_recipient_public_key').value = response['transaction']['recipient_public_key'];
                    document.getElementById('confirmation_amount').value = response['transaction']['amount'];

                    document.getElementById('transaction_signature').value = response['signature'];
    }


I want to have any input for amount that can turn into amount = amount * 10%
But I can not figure where to change it

A: assuming that you want to do the equation, you could simply add another command, e.g.
@app.route('/generate/transaction', methods=['POST'])
def generate_transaction():
    sender_public_key = request.form['sender_public_key']
    sender_private_key = request.form['sender_private_key']
    recipient_public_key = request.form['recipient_public_key']
    amount = request.form['amount']
    fraction_amount = amount * 0.1

    transaction = Transaction(sender_public_key, sender_private_key, 
                              recipient_public_key, fraction_amount)

    response = {'transaction': transaction.to_dict(),
                'signature': transaction.sign_transaction()}

    return jsonify(response), 200

Let me know if that is what you meant.
