Problem: I'm trying to pass a return value from a function into a input field.
I get no errors the field is just blank.
Question: Why is my code not working?
HTML
<tr>
<td>Quantity to be dredged</td>
<td><input type="number" class="" id="shorePipe"></input></td>
</tr>
JavaScript
var shorePipe = function() {
var val = 100;
var val2 = 100;
var total = val * val2 / 100;
// return total;
document.getElementById('shorePipe').value = total;
};
Thanks in advance!