Autofill a textbox in function on pageload
===

My goal is to fill 3 text boxes on pageload of my program using the 

functionintializeFormForDebugging()

I have able to fill them in the style part of my program here but he wants me to call them in a function instead. Here is a example of one of my text box's

    <input id="txtCOGs" type="text" value="4000" /></td>

Does anyone have advice on how to do the same thing except in the function and also why put them in a function instead of just using the style to autofill the boxs.