Q:

Unable to pass a value from a function to a text box

I am very new to JavaScript and I need some help. I am trying to pass a value from a function within the <head> of my HTML document, so that it'll run once the page loads, and I am unable to figure out how to pass a value from the function to a text box within a form in the <body> of the document.
alert ('Starting now');
function calc(){
    const FEES=14.5;
    const DUES=5;
    var cFees;
    var lDues; 
    cFees=FEES * 16;
    lDues=DUES * 16;
    document.getElementById("league");
    }

alert('Finished');

I am unable to understand what I am suppose to do in order to pass along the value of cFees to a text box with the id of "league". The alerts are there to indicate that it is actually starting/ending properly.
EDIT: here is the code that I want to pass the values to
<form>
</div> 
<div id="righta">
<input type="text" name="league"  id="league" readonly />League Dues
<br />
<input type="text" name="fee"  id="fee" readonly />Golf Course Fees
<br />
<input type="text" name="total"  id="total" readonly />Total for the Season
</div> 
</form>

A:

You need to set its value property:
document.getElementById('league').value = cFees;

If you were passing it to an HTML element, you may wish to use innerHTML instead...
e.g. <div id="divTest"></div>
document.getElementById('divTest').innerHTML = cFees;

If you wish it to run when the page loads, then add an event listener to the window...
window.addEventListener(
    'load',
    function() {
        document.getElementById('league').value = cFees;
    },
    false);

FULL CODE EXAMPLE
Here's a full HTML example showing the fields being updated accordingly as per the calc() function. I've set this to update on the load of the window, but you could set it via some other event, if you wish.
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <script>
            function calc() {
                const FEES = 14.5;
                const DUES = 5;
                var cFees = FEES * 16;
                var lDues = DUES * 16;
                document.getElementById('txtFees').value = cFees.toFixed(2);
                document.getElementById('txtDues').value = lDues.toFixed(2);
            }

            window.addEventListener('load', calc, false);
        </script>
    </head>
    <body>
        <input id="txtFees" type="text" value="" readonly>
        <input id="txtDues" type="text" value="" readonly>
    </body>
</html>

